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

io.github.microcks.operator.api.base.v1alpha1.GooglePubSubConnectionSpecFluent Maven / Gradle / Ivy

package io.github.microcks.operator.api.base.v1alpha1;

import io.github.microcks.operator.api.model.SecretReferenceSpecBuilder;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import io.fabric8.kubernetes.api.builder.Nested;
import io.github.microcks.operator.api.model.SecretReferenceSpecFluent;
import java.lang.Object;
import io.github.microcks.operator.api.model.SecretReferenceSpec;
import java.lang.String;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class GooglePubSubConnectionSpecFluent> extends BaseFluent{
  public GooglePubSubConnectionSpecFluent() {
  }
  
  public GooglePubSubConnectionSpecFluent(GooglePubSubConnectionSpec instance) {
    this.copyInstance(instance);
  }
  private String project;
  private SecretReferenceSpecBuilder serviceAccountSecretRef;
  
  protected void copyInstance(GooglePubSubConnectionSpec instance) {
    instance = (instance != null ? instance : new GooglePubSubConnectionSpec());
    if (instance != null) {
          this.withProject(instance.getProject());
          this.withServiceAccountSecretRef(instance.getServiceAccountSecretRef());
        }
  }
  
  public String getProject() {
    return this.project;
  }
  
  public A withProject(String project) {
    this.project = project;
    return (A) this;
  }
  
  public boolean hasProject() {
    return this.project != null;
  }
  
  public SecretReferenceSpec buildServiceAccountSecretRef() {
    return this.serviceAccountSecretRef != null ? this.serviceAccountSecretRef.build() : null;
  }
  
  public A withServiceAccountSecretRef(SecretReferenceSpec serviceAccountSecretRef) {
    this._visitables.remove("serviceAccountSecretRef");
    if (serviceAccountSecretRef != null) {
        this.serviceAccountSecretRef = new SecretReferenceSpecBuilder(serviceAccountSecretRef);
        this._visitables.get("serviceAccountSecretRef").add(this.serviceAccountSecretRef);
    } else {
        this.serviceAccountSecretRef = null;
        this._visitables.get("serviceAccountSecretRef").remove(this.serviceAccountSecretRef);
    }
    return (A) this;
  }
  
  public boolean hasServiceAccountSecretRef() {
    return this.serviceAccountSecretRef != null;
  }
  
  public ServiceAccountSecretRefNested withNewServiceAccountSecretRef() {
    return new ServiceAccountSecretRefNested(null);
  }
  
  public ServiceAccountSecretRefNested withNewServiceAccountSecretRefLike(SecretReferenceSpec item) {
    return new ServiceAccountSecretRefNested(item);
  }
  
  public ServiceAccountSecretRefNested editServiceAccountSecretRef() {
    return withNewServiceAccountSecretRefLike(java.util.Optional.ofNullable(buildServiceAccountSecretRef()).orElse(null));
  }
  
  public ServiceAccountSecretRefNested editOrNewServiceAccountSecretRef() {
    return withNewServiceAccountSecretRefLike(java.util.Optional.ofNullable(buildServiceAccountSecretRef()).orElse(new SecretReferenceSpecBuilder().build()));
  }
  
  public ServiceAccountSecretRefNested editOrNewServiceAccountSecretRefLike(SecretReferenceSpec item) {
    return withNewServiceAccountSecretRefLike(java.util.Optional.ofNullable(buildServiceAccountSecretRef()).orElse(item));
  }
  
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    GooglePubSubConnectionSpecFluent that = (GooglePubSubConnectionSpecFluent) o;
    if (!java.util.Objects.equals(project, that.project)) return false;
    if (!java.util.Objects.equals(serviceAccountSecretRef, that.serviceAccountSecretRef)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(project,  serviceAccountSecretRef,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (project != null) { sb.append("project:"); sb.append(project + ","); }
    if (serviceAccountSecretRef != null) { sb.append("serviceAccountSecretRef:"); sb.append(serviceAccountSecretRef); }
    sb.append("}");
    return sb.toString();
  }
  public class ServiceAccountSecretRefNested extends SecretReferenceSpecFluent> implements Nested{
    ServiceAccountSecretRefNested(SecretReferenceSpec item) {
      this.builder = new SecretReferenceSpecBuilder(this, item);
    }
    SecretReferenceSpecBuilder builder;
    
    public N and() {
      return (N) GooglePubSubConnectionSpecFluent.this.withServiceAccountSecretRef(builder.build());
    }
    
    public N endServiceAccountSecretRef() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy