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

org.cloudfoundry.client.v2.organizations.AssociateOrganizationBillingManagerByUsernameRequest Maven / Gradle / Ivy

There is a newer version: 5.12.2.RELEASE
Show newest version
package org.cloudfoundry.client.v2.organizations;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.cloudfoundry.Nullable;
import org.immutables.value.Generated;

/**
 * The request payload for the Associate Billing Manager with the Organization by Username operation
 */
@Generated(from = "_AssociateOrganizationBillingManagerByUsernameRequest", generator = "Immutables")
@SuppressWarnings({"all"})
@javax.annotation.Generated("org.immutables.processor.ProxyProcessor")
public final class AssociateOrganizationBillingManagerByUsernameRequest
    extends org.cloudfoundry.client.v2.organizations._AssociateOrganizationBillingManagerByUsernameRequest {
  private final String organizationId;
  private final @Nullable String origin;
  private final String username;

  private AssociateOrganizationBillingManagerByUsernameRequest(AssociateOrganizationBillingManagerByUsernameRequest.Builder builder) {
    this.organizationId = builder.organizationId;
    this.origin = builder.origin;
    this.username = builder.username;
  }

  /**
   * The organization id
   */
  @JsonProperty("organizationId")
  @JsonIgnore
  @Override
  public String getOrganizationId() {
    return organizationId;
  }

  /**
   * The origin
   */
  @JsonProperty("origin")
  @Override
  public @Nullable String getOrigin() {
    return origin;
  }

  /**
   * The username
   */
  @JsonProperty("username")
  @Override
  public String getUsername() {
    return username;
  }

  /**
   * This instance is equal to all instances of {@code AssociateOrganizationBillingManagerByUsernameRequest} that have equal attribute values.
   * @return {@code true} if {@code this} is equal to {@code another} instance
   */
  @Override
  public boolean equals(Object another) {
    if (this == another) return true;
    return another instanceof AssociateOrganizationBillingManagerByUsernameRequest
        && equalTo(0, (AssociateOrganizationBillingManagerByUsernameRequest) another);
  }

  private boolean equalTo(int synthetic, AssociateOrganizationBillingManagerByUsernameRequest another) {
    return organizationId.equals(another.organizationId)
        && Objects.equals(origin, another.origin)
        && username.equals(another.username);
  }

  /**
   * Computes a hash code from attributes: {@code organizationId}, {@code origin}, {@code username}.
   * @return hashCode value
   */
  @Override
  public int hashCode() {
    int h = 5381;
    h += (h << 5) + organizationId.hashCode();
    h += (h << 5) + Objects.hashCode(origin);
    h += (h << 5) + username.hashCode();
    return h;
  }

  /**
   * Prints the immutable value {@code AssociateOrganizationBillingManagerByUsernameRequest} with attribute values.
   * @return A string representation of the value
   */
  @Override
  public String toString() {
    return "AssociateOrganizationBillingManagerByUsernameRequest{"
        + "organizationId=" + organizationId
        + ", origin=" + origin
        + ", username=" + username
        + "}";
  }

  /**
   * Utility type used to correctly read immutable object from JSON representation.
   * @deprecated Do not use this type directly, it exists only for the Jackson-binding infrastructure
   */
  @Generated(from = "_AssociateOrganizationBillingManagerByUsernameRequest", generator = "Immutables")
  @Deprecated
  @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE)
  static final class Json
      extends org.cloudfoundry.client.v2.organizations._AssociateOrganizationBillingManagerByUsernameRequest {
    String organizationId;
    String origin;
    String username;
    @JsonProperty("organizationId")
    @JsonIgnore
    public void setOrganizationId(String organizationId) {
      this.organizationId = organizationId;
    }
    @JsonProperty("origin")
    public void setOrigin(@Nullable String origin) {
      this.origin = origin;
    }
    @JsonProperty("username")
    public void setUsername(String username) {
      this.username = username;
    }
    @Override
    public String getOrganizationId() { throw new UnsupportedOperationException(); }
    @Override
    public String getOrigin() { throw new UnsupportedOperationException(); }
    @Override
    public String getUsername() { throw new UnsupportedOperationException(); }
  }

  /**
   * @param json A JSON-bindable data structure
   * @return An immutable value type
   * @deprecated Do not use this method directly, it exists only for the Jackson-binding infrastructure
   */
  @Deprecated
  @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
  static AssociateOrganizationBillingManagerByUsernameRequest fromJson(Json json) {
    AssociateOrganizationBillingManagerByUsernameRequest.Builder builder = AssociateOrganizationBillingManagerByUsernameRequest.builder();
    if (json.organizationId != null) {
      builder.organizationId(json.organizationId);
    }
    if (json.origin != null) {
      builder.origin(json.origin);
    }
    if (json.username != null) {
      builder.username(json.username);
    }
    return builder.build();
  }

  /**
   * Creates a builder for {@link AssociateOrganizationBillingManagerByUsernameRequest AssociateOrganizationBillingManagerByUsernameRequest}.
   * 
   * AssociateOrganizationBillingManagerByUsernameRequest.builder()
   *    .organizationId(String) // required {@link AssociateOrganizationBillingManagerByUsernameRequest#getOrganizationId() organizationId}
   *    .origin(String | null) // nullable {@link AssociateOrganizationBillingManagerByUsernameRequest#getOrigin() origin}
   *    .username(String) // required {@link AssociateOrganizationBillingManagerByUsernameRequest#getUsername() username}
   *    .build();
   * 
* @return A new AssociateOrganizationBillingManagerByUsernameRequest builder */ public static AssociateOrganizationBillingManagerByUsernameRequest.Builder builder() { return new AssociateOrganizationBillingManagerByUsernameRequest.Builder(); } /** * Builds instances of type {@link AssociateOrganizationBillingManagerByUsernameRequest AssociateOrganizationBillingManagerByUsernameRequest}. * Initialize attributes and then invoke the {@link #build()} method to create an * immutable instance. *

{@code Builder} is not thread-safe and generally should not be stored in a field or collection, * but instead used immediately to create instances. */ @Generated(from = "_AssociateOrganizationBillingManagerByUsernameRequest", generator = "Immutables") public static final class Builder { private static final long INIT_BIT_ORGANIZATION_ID = 0x1L; private static final long INIT_BIT_USERNAME = 0x2L; private long initBits = 0x3L; private String organizationId; private String origin; private String username; private Builder() { } /** * Fill a builder with attribute values from the provided {@code AssociateOrganizationBillingManagerByUsernameRequest} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(AssociateOrganizationBillingManagerByUsernameRequest instance) { return from((_AssociateOrganizationBillingManagerByUsernameRequest) instance); } /** * Copy abstract value type {@code _AssociateOrganizationBillingManagerByUsernameRequest} instance into builder. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ final Builder from(_AssociateOrganizationBillingManagerByUsernameRequest instance) { Objects.requireNonNull(instance, "instance"); organizationId(instance.getOrganizationId()); String originValue = instance.getOrigin(); if (originValue != null) { origin(originValue); } username(instance.getUsername()); return this; } /** * Initializes the value for the {@link AssociateOrganizationBillingManagerByUsernameRequest#getOrganizationId() organizationId} attribute. * @param organizationId The value for organizationId * @return {@code this} builder for use in a chained invocation */ public final Builder organizationId(String organizationId) { this.organizationId = Objects.requireNonNull(organizationId, "organizationId"); initBits &= ~INIT_BIT_ORGANIZATION_ID; return this; } /** * Initializes the value for the {@link AssociateOrganizationBillingManagerByUsernameRequest#getOrigin() origin} attribute. * @param origin The value for origin (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ public final Builder origin(@Nullable String origin) { this.origin = origin; return this; } /** * Initializes the value for the {@link AssociateOrganizationBillingManagerByUsernameRequest#getUsername() username} attribute. * @param username The value for username * @return {@code this} builder for use in a chained invocation */ public final Builder username(String username) { this.username = Objects.requireNonNull(username, "username"); initBits &= ~INIT_BIT_USERNAME; return this; } /** * Builds a new {@link AssociateOrganizationBillingManagerByUsernameRequest AssociateOrganizationBillingManagerByUsernameRequest}. * @return An immutable instance of AssociateOrganizationBillingManagerByUsernameRequest * @throws java.lang.IllegalStateException if any required attributes are missing */ public AssociateOrganizationBillingManagerByUsernameRequest build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new AssociateOrganizationBillingManagerByUsernameRequest(this); } private String formatRequiredAttributesMessage() { List attributes = new ArrayList<>(); if ((initBits & INIT_BIT_ORGANIZATION_ID) != 0) attributes.add("organizationId"); if ((initBits & INIT_BIT_USERNAME) != 0) attributes.add("username"); return "Cannot build AssociateOrganizationBillingManagerByUsernameRequest, some of required attributes are not set " + attributes; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy