All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.strimzi.api.kafka.model.authentication.KafkaClientAuthenticationOAuthFluentImpl Maven / Gradle / Ivy

There is a newer version: 0.45.0
Show newest version
package io.strimzi.api.kafka.model.authentication;

import io.strimzi.api.kafka.model.GenericSecretSource;
import io.strimzi.api.kafka.model.GenericSecretSourceBuilder;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import io.strimzi.api.kafka.model.CertSecretSourceFluentImpl;
import java.lang.StringBuilder;
import io.fabric8.kubernetes.api.builder.Nested;
import io.strimzi.api.kafka.model.GenericSecretSourceFluentImpl;
import java.util.ArrayList;
import java.lang.String;
import io.fabric8.kubernetes.api.builder.Predicate;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Iterator;
import java.util.List;
import java.lang.Boolean;
import java.lang.StringBuffer;
import io.strimzi.api.kafka.model.CertSecretSourceBuilder;
import java.util.Collection;
import java.lang.Object;
import io.strimzi.api.kafka.model.CertSecretSource;

public class KafkaClientAuthenticationOAuthFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements KafkaClientAuthenticationOAuthFluent{

    private String clientId;
    private String scope;
    private String tokenEndpointUri;
    private GenericSecretSourceBuilder clientSecret;
    private GenericSecretSourceBuilder accessToken;
    private GenericSecretSourceBuilder refreshToken;
    private java.util.List tlsTrustedCertificates;
    private boolean disableTlsHostnameVerification;
    private int maxTokenExpirySeconds;
    private boolean accessTokenIsJwt;

    public KafkaClientAuthenticationOAuthFluentImpl(){
    }
    public KafkaClientAuthenticationOAuthFluentImpl(KafkaClientAuthenticationOAuth instance){
            this.withClientId(instance.getClientId());

            this.withScope(instance.getScope());

            this.withTokenEndpointUri(instance.getTokenEndpointUri());

            this.withClientSecret(instance.getClientSecret());

            this.withAccessToken(instance.getAccessToken());

            this.withRefreshToken(instance.getRefreshToken());

            this.withTlsTrustedCertificates(instance.getTlsTrustedCertificates());

            this.withDisableTlsHostnameVerification(instance.isDisableTlsHostnameVerification());

            this.withMaxTokenExpirySeconds(instance.getMaxTokenExpirySeconds());

            this.withAccessTokenIsJwt(instance.isAccessTokenIsJwt());

    }

    public String getClientId(){
            return this.clientId;
    }

    public A withClientId(String clientId){
            this.clientId=clientId; return (A) this;
    }

    public Boolean hasClientId(){
            return this.clientId != null;
    }

    public A withNewClientId(String arg1){
            return (A)withClientId(new String(arg1));
    }

    public A withNewClientId(StringBuilder arg1){
            return (A)withClientId(new String(arg1));
    }

    public A withNewClientId(StringBuffer arg1){
            return (A)withClientId(new String(arg1));
    }

    public String getScope(){
            return this.scope;
    }

    public A withScope(String scope){
            this.scope=scope; return (A) this;
    }

    public Boolean hasScope(){
            return this.scope != null;
    }

    public A withNewScope(String arg1){
            return (A)withScope(new String(arg1));
    }

    public A withNewScope(StringBuilder arg1){
            return (A)withScope(new String(arg1));
    }

    public A withNewScope(StringBuffer arg1){
            return (A)withScope(new String(arg1));
    }

    public String getTokenEndpointUri(){
            return this.tokenEndpointUri;
    }

    public A withTokenEndpointUri(String tokenEndpointUri){
            this.tokenEndpointUri=tokenEndpointUri; return (A) this;
    }

    public Boolean hasTokenEndpointUri(){
            return this.tokenEndpointUri != null;
    }

    public A withNewTokenEndpointUri(String arg1){
            return (A)withTokenEndpointUri(new String(arg1));
    }

    public A withNewTokenEndpointUri(StringBuilder arg1){
            return (A)withTokenEndpointUri(new String(arg1));
    }

    public A withNewTokenEndpointUri(StringBuffer arg1){
            return (A)withTokenEndpointUri(new String(arg1));
    }

    
/**
 * This method has been deprecated, please use method buildClientSecret instead.
 * @return The buildable object.
 */
@Deprecated public GenericSecretSource getClientSecret(){
            return this.clientSecret!=null?this.clientSecret.build():null;
    }

    public GenericSecretSource buildClientSecret(){
            return this.clientSecret!=null?this.clientSecret.build():null;
    }

    public A withClientSecret(GenericSecretSource clientSecret){
            _visitables.get("clientSecret").remove(this.clientSecret);
            if (clientSecret!=null){ this.clientSecret= new GenericSecretSourceBuilder(clientSecret); _visitables.get("clientSecret").add(this.clientSecret);} return (A) this;
    }

    public Boolean hasClientSecret(){
            return this.clientSecret != null;
    }

    public KafkaClientAuthenticationOAuthFluent.ClientSecretNested withNewClientSecret(){
            return new ClientSecretNestedImpl();
    }

    public KafkaClientAuthenticationOAuthFluent.ClientSecretNested withNewClientSecretLike(GenericSecretSource item){
            return new ClientSecretNestedImpl(item);
    }

    public KafkaClientAuthenticationOAuthFluent.ClientSecretNested editClientSecret(){
            return withNewClientSecretLike(getClientSecret());
    }

    public KafkaClientAuthenticationOAuthFluent.ClientSecretNested editOrNewClientSecret(){
            return withNewClientSecretLike(getClientSecret() != null ? getClientSecret(): new GenericSecretSourceBuilder().build());
    }

    public KafkaClientAuthenticationOAuthFluent.ClientSecretNested editOrNewClientSecretLike(GenericSecretSource item){
            return withNewClientSecretLike(getClientSecret() != null ? getClientSecret(): item);
    }

    
/**
 * This method has been deprecated, please use method buildAccessToken instead.
 * @return The buildable object.
 */
@Deprecated public GenericSecretSource getAccessToken(){
            return this.accessToken!=null?this.accessToken.build():null;
    }

    public GenericSecretSource buildAccessToken(){
            return this.accessToken!=null?this.accessToken.build():null;
    }

    public A withAccessToken(GenericSecretSource accessToken){
            _visitables.get("accessToken").remove(this.accessToken);
            if (accessToken!=null){ this.accessToken= new GenericSecretSourceBuilder(accessToken); _visitables.get("accessToken").add(this.accessToken);} return (A) this;
    }

    public Boolean hasAccessToken(){
            return this.accessToken != null;
    }

    public KafkaClientAuthenticationOAuthFluent.AccessTokenNested withNewAccessToken(){
            return new AccessTokenNestedImpl();
    }

    public KafkaClientAuthenticationOAuthFluent.AccessTokenNested withNewAccessTokenLike(GenericSecretSource item){
            return new AccessTokenNestedImpl(item);
    }

    public KafkaClientAuthenticationOAuthFluent.AccessTokenNested editAccessToken(){
            return withNewAccessTokenLike(getAccessToken());
    }

    public KafkaClientAuthenticationOAuthFluent.AccessTokenNested editOrNewAccessToken(){
            return withNewAccessTokenLike(getAccessToken() != null ? getAccessToken(): new GenericSecretSourceBuilder().build());
    }

    public KafkaClientAuthenticationOAuthFluent.AccessTokenNested editOrNewAccessTokenLike(GenericSecretSource item){
            return withNewAccessTokenLike(getAccessToken() != null ? getAccessToken(): item);
    }

    
/**
 * This method has been deprecated, please use method buildRefreshToken instead.
 * @return The buildable object.
 */
@Deprecated public GenericSecretSource getRefreshToken(){
            return this.refreshToken!=null?this.refreshToken.build():null;
    }

    public GenericSecretSource buildRefreshToken(){
            return this.refreshToken!=null?this.refreshToken.build():null;
    }

    public A withRefreshToken(GenericSecretSource refreshToken){
            _visitables.get("refreshToken").remove(this.refreshToken);
            if (refreshToken!=null){ this.refreshToken= new GenericSecretSourceBuilder(refreshToken); _visitables.get("refreshToken").add(this.refreshToken);} return (A) this;
    }

    public Boolean hasRefreshToken(){
            return this.refreshToken != null;
    }

    public KafkaClientAuthenticationOAuthFluent.RefreshTokenNested withNewRefreshToken(){
            return new RefreshTokenNestedImpl();
    }

    public KafkaClientAuthenticationOAuthFluent.RefreshTokenNested withNewRefreshTokenLike(GenericSecretSource item){
            return new RefreshTokenNestedImpl(item);
    }

    public KafkaClientAuthenticationOAuthFluent.RefreshTokenNested editRefreshToken(){
            return withNewRefreshTokenLike(getRefreshToken());
    }

    public KafkaClientAuthenticationOAuthFluent.RefreshTokenNested editOrNewRefreshToken(){
            return withNewRefreshTokenLike(getRefreshToken() != null ? getRefreshToken(): new GenericSecretSourceBuilder().build());
    }

    public KafkaClientAuthenticationOAuthFluent.RefreshTokenNested editOrNewRefreshTokenLike(GenericSecretSource item){
            return withNewRefreshTokenLike(getRefreshToken() != null ? getRefreshToken(): item);
    }

    public A addToTlsTrustedCertificates(int index,CertSecretSource item){
            if (this.tlsTrustedCertificates == null) {this.tlsTrustedCertificates = new ArrayList();}
            CertSecretSourceBuilder builder = new CertSecretSourceBuilder(item);_visitables.get("tlsTrustedCertificates").add(index >= 0 ? index : _visitables.get("tlsTrustedCertificates").size(), builder);this.tlsTrustedCertificates.add(index >= 0 ? index : tlsTrustedCertificates.size(), builder); return (A)this;
    }

    public A setToTlsTrustedCertificates(int index,CertSecretSource item){
            if (this.tlsTrustedCertificates == null) {this.tlsTrustedCertificates = new ArrayList();}
            CertSecretSourceBuilder builder = new CertSecretSourceBuilder(item);
            if (index < 0 || index >= _visitables.get("tlsTrustedCertificates").size()) { _visitables.get("tlsTrustedCertificates").add(builder); } else { _visitables.get("tlsTrustedCertificates").set(index, builder);}
            if (index < 0 || index >= tlsTrustedCertificates.size()) { tlsTrustedCertificates.add(builder); } else { tlsTrustedCertificates.set(index, builder);}
             return (A)this;
    }

    public A addToTlsTrustedCertificates(CertSecretSource... items){
            if (this.tlsTrustedCertificates == null) {this.tlsTrustedCertificates = new ArrayList();}
            for (CertSecretSource item : items) {CertSecretSourceBuilder builder = new CertSecretSourceBuilder(item);_visitables.get("tlsTrustedCertificates").add(builder);this.tlsTrustedCertificates.add(builder);} return (A)this;
    }

    public A addAllToTlsTrustedCertificates(Collection items){
            if (this.tlsTrustedCertificates == null) {this.tlsTrustedCertificates = new ArrayList();}
            for (CertSecretSource item : items) {CertSecretSourceBuilder builder = new CertSecretSourceBuilder(item);_visitables.get("tlsTrustedCertificates").add(builder);this.tlsTrustedCertificates.add(builder);} return (A)this;
    }

    public A removeFromTlsTrustedCertificates(CertSecretSource... items){
            for (CertSecretSource item : items) {CertSecretSourceBuilder builder = new CertSecretSourceBuilder(item);_visitables.get("tlsTrustedCertificates").remove(builder);if (this.tlsTrustedCertificates != null) {this.tlsTrustedCertificates.remove(builder);}} return (A)this;
    }

    public A removeAllFromTlsTrustedCertificates(Collection items){
            for (CertSecretSource item : items) {CertSecretSourceBuilder builder = new CertSecretSourceBuilder(item);_visitables.get("tlsTrustedCertificates").remove(builder);if (this.tlsTrustedCertificates != null) {this.tlsTrustedCertificates.remove(builder);}} return (A)this;
    }

    public A removeMatchingFromTlsTrustedCertificates(io.fabric8.kubernetes.api.builder.Predicate predicate){
            if (tlsTrustedCertificates == null) return (A) this;
            final Iterator each = tlsTrustedCertificates.iterator();
            final List visitables = _visitables.get("tlsTrustedCertificates");
            while (each.hasNext()) {
              CertSecretSourceBuilder builder = each.next();
              if (predicate.apply(builder)) {
                visitables.remove(builder);
                each.remove();
              }
            }
            return (A)this;
    }

    
/**
 * This method has been deprecated, please use method buildTlsTrustedCertificates instead.
 * @return The buildable object.
 */
@Deprecated public java.util.List getTlsTrustedCertificates(){
            return build(tlsTrustedCertificates);
    }

    public java.util.List buildTlsTrustedCertificates(){
            return build(tlsTrustedCertificates);
    }

    public CertSecretSource buildTlsTrustedCertificate(int index){
            return this.tlsTrustedCertificates.get(index).build();
    }

    public CertSecretSource buildFirstTlsTrustedCertificate(){
            return this.tlsTrustedCertificates.get(0).build();
    }

    public CertSecretSource buildLastTlsTrustedCertificate(){
            return this.tlsTrustedCertificates.get(tlsTrustedCertificates.size() - 1).build();
    }

    public CertSecretSource buildMatchingTlsTrustedCertificate(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (CertSecretSourceBuilder item: tlsTrustedCertificates) { if(predicate.apply(item)){ return item.build();} } return null;
    }

    public Boolean hasMatchingTlsTrustedCertificate(io.fabric8.kubernetes.api.builder.Predicate predicate){
            for (CertSecretSourceBuilder item: tlsTrustedCertificates) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withTlsTrustedCertificates(java.util.List tlsTrustedCertificates){
            if (this.tlsTrustedCertificates != null) { _visitables.get("tlsTrustedCertificates").removeAll(this.tlsTrustedCertificates);}
            if (tlsTrustedCertificates != null) {this.tlsTrustedCertificates = new ArrayList(); for (CertSecretSource item : tlsTrustedCertificates){this.addToTlsTrustedCertificates(item);}} else { this.tlsTrustedCertificates = null;} return (A) this;
    }

    public A withTlsTrustedCertificates(CertSecretSource... tlsTrustedCertificates){
            if (this.tlsTrustedCertificates != null) {this.tlsTrustedCertificates.clear();}
            if (tlsTrustedCertificates != null) {for (CertSecretSource item :tlsTrustedCertificates){ this.addToTlsTrustedCertificates(item);}} return (A) this;
    }

    public Boolean hasTlsTrustedCertificates(){
            return tlsTrustedCertificates != null && !tlsTrustedCertificates.isEmpty();
    }

    public KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested addNewTlsTrustedCertificate(){
            return new TlsTrustedCertificatesNestedImpl();
    }

    public KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested addNewTlsTrustedCertificateLike(CertSecretSource item){
            return new TlsTrustedCertificatesNestedImpl(-1, item);
    }

    public KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested setNewTlsTrustedCertificateLike(int index,CertSecretSource item){
            return new TlsTrustedCertificatesNestedImpl(index, item);
    }

    public KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested editTlsTrustedCertificate(int index){
            if (tlsTrustedCertificates.size() <= index) throw new RuntimeException("Can't edit tlsTrustedCertificates. Index exceeds size.");
            return setNewTlsTrustedCertificateLike(index, buildTlsTrustedCertificate(index));
    }

    public KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested editFirstTlsTrustedCertificate(){
            if (tlsTrustedCertificates.size() == 0) throw new RuntimeException("Can't edit first tlsTrustedCertificates. The list is empty.");
            return setNewTlsTrustedCertificateLike(0, buildTlsTrustedCertificate(0));
    }

    public KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested editLastTlsTrustedCertificate(){
            int index = tlsTrustedCertificates.size() - 1;
            if (index < 0) throw new RuntimeException("Can't edit last tlsTrustedCertificates. The list is empty.");
            return setNewTlsTrustedCertificateLike(index, buildTlsTrustedCertificate(index));
    }

    public KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested editMatchingTlsTrustedCertificate(io.fabric8.kubernetes.api.builder.Predicate predicate){
            int index = -1;
            for (int i=0;i extends GenericSecretSourceFluentImpl> implements KafkaClientAuthenticationOAuthFluent.ClientSecretNested,io.fabric8.kubernetes.api.builder.Nested{

            private final GenericSecretSourceBuilder builder;
    
            ClientSecretNestedImpl(GenericSecretSource item){
                    this.builder = new GenericSecretSourceBuilder(this, item);
            }
            ClientSecretNestedImpl(){
                    this.builder = new GenericSecretSourceBuilder(this);
            }
    
    public N and(){
            return (N) KafkaClientAuthenticationOAuthFluentImpl.this.withClientSecret(builder.build());
    }
    public N endClientSecret(){
            return and();
    }

}
    public class AccessTokenNestedImpl extends GenericSecretSourceFluentImpl> implements KafkaClientAuthenticationOAuthFluent.AccessTokenNested,io.fabric8.kubernetes.api.builder.Nested{

            private final GenericSecretSourceBuilder builder;
    
            AccessTokenNestedImpl(GenericSecretSource item){
                    this.builder = new GenericSecretSourceBuilder(this, item);
            }
            AccessTokenNestedImpl(){
                    this.builder = new GenericSecretSourceBuilder(this);
            }
    
    public N and(){
            return (N) KafkaClientAuthenticationOAuthFluentImpl.this.withAccessToken(builder.build());
    }
    public N endAccessToken(){
            return and();
    }

}
    public class RefreshTokenNestedImpl extends GenericSecretSourceFluentImpl> implements KafkaClientAuthenticationOAuthFluent.RefreshTokenNested,io.fabric8.kubernetes.api.builder.Nested{

            private final GenericSecretSourceBuilder builder;
    
            RefreshTokenNestedImpl(GenericSecretSource item){
                    this.builder = new GenericSecretSourceBuilder(this, item);
            }
            RefreshTokenNestedImpl(){
                    this.builder = new GenericSecretSourceBuilder(this);
            }
    
    public N and(){
            return (N) KafkaClientAuthenticationOAuthFluentImpl.this.withRefreshToken(builder.build());
    }
    public N endRefreshToken(){
            return and();
    }

}
    public class TlsTrustedCertificatesNestedImpl extends CertSecretSourceFluentImpl> implements KafkaClientAuthenticationOAuthFluent.TlsTrustedCertificatesNested,io.fabric8.kubernetes.api.builder.Nested{

            private final CertSecretSourceBuilder builder;
        private final int index;
    
            TlsTrustedCertificatesNestedImpl(int index,CertSecretSource item){
                    this.index = index;
                    this.builder = new CertSecretSourceBuilder(this, item);
            }
            TlsTrustedCertificatesNestedImpl(){
                    this.index = -1;
                    this.builder = new CertSecretSourceBuilder(this);
            }
    
    public N and(){
            return (N) KafkaClientAuthenticationOAuthFluentImpl.this.setToTlsTrustedCertificates(index, builder.build());
    }
    public N endTlsTrustedCertificate(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy