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

com.dominodatalab.api.model.DominoNucleusModelproductModelsPermissionsData Maven / Gradle / Ivy

/*
 * Domino Data Lab API v4
 * This API is going to provide access to all the Domino functions available in the user interface. To authenticate your requests, include your API Key (which you can find on your account page) with the header X-Domino-Api-Key. 
 *
 * The version of the OpenAPI document: 4.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.dominodatalab.api.model;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


/**
 * ModelProduct permissions
 */
@JsonPropertyOrder({
  DominoNucleusModelproductModelsPermissionsData.JSON_PROPERTY_APP_ACCESS_STATUS,
  DominoNucleusModelproductModelsPermissionsData.JSON_PROPERTY_PENDING_INVITATIONS,
  DominoNucleusModelproductModelsPermissionsData.JSON_PROPERTY_VISIBILITY,
  DominoNucleusModelproductModelsPermissionsData.JSON_PROPERTY_DISCOVERABLE,
  DominoNucleusModelproductModelsPermissionsData.JSON_PROPERTY_ACCESS_REQUEST_STATUSES
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-10-17T15:20:46.682098100-04:00[America/New_York]")
public class DominoNucleusModelproductModelsPermissionsData {
  /**
   * Gets or Sets appAccessStatus
   */
  public enum AppAccessStatusEnum {
    ALLOWED("ALLOWED"),
    
    PENDING("PENDING"),
    
    REQUESTABLE("REQUESTABLE"),
    
    NOT_ALLOWED("NOT_ALLOWED");

    private String value;

    AppAccessStatusEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static AppAccessStatusEnum fromValue(String value) {
      for (AppAccessStatusEnum b : AppAccessStatusEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_APP_ACCESS_STATUS = "appAccessStatus";
  private AppAccessStatusEnum appAccessStatus;

  public static final String JSON_PROPERTY_PENDING_INVITATIONS = "pendingInvitations";
  private List pendingInvitations = new ArrayList<>();

  /**
   * Gets or Sets visibility
   */
  public enum VisibilityEnum {
    PUBLIC("PUBLIC"),
    
    AUTHENTICATED("AUTHENTICATED"),
    
    GRANT_BASED("GRANT_BASED"),
    
    GRANT_BASED_STRICT("GRANT_BASED_STRICT");

    private String value;

    VisibilityEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static VisibilityEnum fromValue(String value) {
      for (VisibilityEnum b : VisibilityEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_VISIBILITY = "visibility";
  private VisibilityEnum visibility;

  public static final String JSON_PROPERTY_DISCOVERABLE = "discoverable";
  private Boolean discoverable;

  public static final String JSON_PROPERTY_ACCESS_REQUEST_STATUSES = "accessRequestStatuses";
  private Map accessRequestStatuses = new HashMap<>();

  public DominoNucleusModelproductModelsPermissionsData() { 
  }

  public DominoNucleusModelproductModelsPermissionsData appAccessStatus(AppAccessStatusEnum appAccessStatus) {
    this.appAccessStatus = appAccessStatus;
    return this;
  }

   /**
   * Get appAccessStatus
   * @return appAccessStatus
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_APP_ACCESS_STATUS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public AppAccessStatusEnum getAppAccessStatus() {
    return appAccessStatus;
  }


  @JsonProperty(JSON_PROPERTY_APP_ACCESS_STATUS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setAppAccessStatus(AppAccessStatusEnum appAccessStatus) {
    this.appAccessStatus = appAccessStatus;
  }


  public DominoNucleusModelproductModelsPermissionsData pendingInvitations(List pendingInvitations) {
    this.pendingInvitations = pendingInvitations;
    return this;
  }

  public DominoNucleusModelproductModelsPermissionsData addPendingInvitationsItem(String pendingInvitationsItem) {
    if (this.pendingInvitations == null) {
      this.pendingInvitations = new ArrayList<>();
    }
    this.pendingInvitations.add(pendingInvitationsItem);
    return this;
  }

   /**
   * Get pendingInvitations
   * @return pendingInvitations
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_PENDING_INVITATIONS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getPendingInvitations() {
    return pendingInvitations;
  }


  @JsonProperty(JSON_PROPERTY_PENDING_INVITATIONS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setPendingInvitations(List pendingInvitations) {
    this.pendingInvitations = pendingInvitations;
  }


  public DominoNucleusModelproductModelsPermissionsData visibility(VisibilityEnum visibility) {
    this.visibility = visibility;
    return this;
  }

   /**
   * Get visibility
   * @return visibility
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_VISIBILITY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public VisibilityEnum getVisibility() {
    return visibility;
  }


  @JsonProperty(JSON_PROPERTY_VISIBILITY)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setVisibility(VisibilityEnum visibility) {
    this.visibility = visibility;
  }


  public DominoNucleusModelproductModelsPermissionsData discoverable(Boolean discoverable) {
    this.discoverable = discoverable;
    return this;
  }

   /**
   * Get discoverable
   * @return discoverable
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DISCOVERABLE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getDiscoverable() {
    return discoverable;
  }


  @JsonProperty(JSON_PROPERTY_DISCOVERABLE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDiscoverable(Boolean discoverable) {
    this.discoverable = discoverable;
  }


  public DominoNucleusModelproductModelsPermissionsData accessRequestStatuses(Map accessRequestStatuses) {
    this.accessRequestStatuses = accessRequestStatuses;
    return this;
  }

  public DominoNucleusModelproductModelsPermissionsData putAccessRequestStatusesItem(String key, String accessRequestStatusesItem) {
    if (this.accessRequestStatuses == null) {
      this.accessRequestStatuses = new HashMap<>();
    }
    this.accessRequestStatuses.put(key, accessRequestStatusesItem);
    return this;
  }

   /**
   * Get accessRequestStatuses
   * @return accessRequestStatuses
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ACCESS_REQUEST_STATUSES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Map getAccessRequestStatuses() {
    return accessRequestStatuses;
  }


  @JsonProperty(JSON_PROPERTY_ACCESS_REQUEST_STATUSES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setAccessRequestStatuses(Map accessRequestStatuses) {
    this.accessRequestStatuses = accessRequestStatuses;
  }


  /**
   * Return true if this domino.nucleus.modelproduct.models.PermissionsData object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DominoNucleusModelproductModelsPermissionsData dominoNucleusModelproductModelsPermissionsData = (DominoNucleusModelproductModelsPermissionsData) o;
    return Objects.equals(this.appAccessStatus, dominoNucleusModelproductModelsPermissionsData.appAccessStatus) &&
        Objects.equals(this.pendingInvitations, dominoNucleusModelproductModelsPermissionsData.pendingInvitations) &&
        Objects.equals(this.visibility, dominoNucleusModelproductModelsPermissionsData.visibility) &&
        Objects.equals(this.discoverable, dominoNucleusModelproductModelsPermissionsData.discoverable) &&
        Objects.equals(this.accessRequestStatuses, dominoNucleusModelproductModelsPermissionsData.accessRequestStatuses);
  }

  @Override
  public int hashCode() {
    return Objects.hash(appAccessStatus, pendingInvitations, visibility, discoverable, accessRequestStatuses);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DominoNucleusModelproductModelsPermissionsData {\n");
    sb.append("    appAccessStatus: ").append(toIndentedString(appAccessStatus)).append("\n");
    sb.append("    pendingInvitations: ").append(toIndentedString(pendingInvitations)).append("\n");
    sb.append("    visibility: ").append(toIndentedString(visibility)).append("\n");
    sb.append("    discoverable: ").append(toIndentedString(discoverable)).append("\n");
    sb.append("    accessRequestStatuses: ").append(toIndentedString(accessRequestStatuses)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

  /**
   * Convert the instance into URL query string.
   *
   * @return URL query string
   */
  public String toUrlQueryString() {
    return toUrlQueryString(null);
  }

  /**
   * Convert the instance into URL query string.
   *
   * @param prefix prefix of the query string
   * @return URL query string
   */
  public String toUrlQueryString(String prefix) {
    String suffix = "";
    String containerSuffix = "";
    String containerPrefix = "";
    if (prefix == null) {
      // style=form, explode=true, e.g. /pet?name=cat&type=manx
      prefix = "";
    } else {
      // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
      prefix = prefix + "[";
      suffix = "]";
      containerSuffix = "]";
      containerPrefix = "[";
    }

    StringJoiner joiner = new StringJoiner("&");

    // add `appAccessStatus` to the URL query string
    if (getAppAccessStatus() != null) {
      joiner.add(String.format("%sappAccessStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAppAccessStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `pendingInvitations` to the URL query string
    if (getPendingInvitations() != null) {
      for (int i = 0; i < getPendingInvitations().size(); i++) {
        joiner.add(String.format("%spendingInvitations%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
            URLEncoder.encode(String.valueOf(getPendingInvitations().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
      }
    }

    // add `visibility` to the URL query string
    if (getVisibility() != null) {
      joiner.add(String.format("%svisibility%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getVisibility()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `discoverable` to the URL query string
    if (getDiscoverable() != null) {
      joiner.add(String.format("%sdiscoverable%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDiscoverable()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `accessRequestStatuses` to the URL query string
    if (getAccessRequestStatuses() != null) {
      for (String _key : getAccessRequestStatuses().keySet()) {
        joiner.add(String.format("%saccessRequestStatuses%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix),
            getAccessRequestStatuses().get(_key), URLEncoder.encode(String.valueOf(getAccessRequestStatuses().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
      }
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy