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

software.amazon.awssdk.services.sagemaker.model.Workforce Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.sagemaker.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* A single private workforce, which is automatically created when you create your first private work team. You can * create one private work force in each AWS Region. By default, any workforce-related API operation used in a specific * region will apply to the workforce created in that region. To learn how to create a private workforce, see Create a Private * Workforce. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Workforce implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField WORKFORCE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("WorkforceName").getter(getter(Workforce::workforceName)).setter(setter(Builder::workforceName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkforceName").build()).build(); private static final SdkField WORKFORCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("WorkforceArn").getter(getter(Workforce::workforceArn)).setter(setter(Builder::workforceArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkforceArn").build()).build(); private static final SdkField LAST_UPDATED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("LastUpdatedDate").getter(getter(Workforce::lastUpdatedDate)).setter(setter(Builder::lastUpdatedDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedDate").build()).build(); private static final SdkField SOURCE_IP_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SourceIpConfig") .getter(getter(Workforce::sourceIpConfig)).setter(setter(Builder::sourceIpConfig)) .constructor(SourceIpConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceIpConfig").build()).build(); private static final SdkField SUB_DOMAIN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SubDomain").getter(getter(Workforce::subDomain)).setter(setter(Builder::subDomain)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubDomain").build()).build(); private static final SdkField COGNITO_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("CognitoConfig") .getter(getter(Workforce::cognitoConfig)).setter(setter(Builder::cognitoConfig)).constructor(CognitoConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CognitoConfig").build()).build(); private static final SdkField OIDC_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("OidcConfig") .getter(getter(Workforce::oidcConfig)).setter(setter(Builder::oidcConfig)) .constructor(OidcConfigForResponse::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OidcConfig").build()).build(); private static final SdkField CREATE_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreateDate").getter(getter(Workforce::createDate)).setter(setter(Builder::createDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateDate").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(WORKFORCE_NAME_FIELD, WORKFORCE_ARN_FIELD, LAST_UPDATED_DATE_FIELD, SOURCE_IP_CONFIG_FIELD, SUB_DOMAIN_FIELD, COGNITO_CONFIG_FIELD, OIDC_CONFIG_FIELD, CREATE_DATE_FIELD)); private static final long serialVersionUID = 1L; private final String workforceName; private final String workforceArn; private final Instant lastUpdatedDate; private final SourceIpConfig sourceIpConfig; private final String subDomain; private final CognitoConfig cognitoConfig; private final OidcConfigForResponse oidcConfig; private final Instant createDate; private Workforce(BuilderImpl builder) { this.workforceName = builder.workforceName; this.workforceArn = builder.workforceArn; this.lastUpdatedDate = builder.lastUpdatedDate; this.sourceIpConfig = builder.sourceIpConfig; this.subDomain = builder.subDomain; this.cognitoConfig = builder.cognitoConfig; this.oidcConfig = builder.oidcConfig; this.createDate = builder.createDate; } /** *

* The name of the private workforce. *

* * @return The name of the private workforce. */ public final String workforceName() { return workforceName; } /** *

* The Amazon Resource Name (ARN) of the private workforce. *

* * @return The Amazon Resource Name (ARN) of the private workforce. */ public final String workforceArn() { return workforceArn; } /** *

* The most recent date that was used to successfully add one or more IP address ranges (CIDRs) to a private workforce's * allow list. *

* * @return The most recent date that was used to successfully add one or more IP address ranges (CIDRs) to a private * workforce's allow list. */ public final Instant lastUpdatedDate() { return lastUpdatedDate; } /** *

* A list of one to ten IP address ranges (CIDRs) to be added to the workforce * allow list. By default, a workforce isn't restricted to specific IP addresses. *

* * @return A list of one to ten IP address ranges (CIDRs) to be added to the * workforce allow list. By default, a workforce isn't restricted to specific IP addresses. */ public final SourceIpConfig sourceIpConfig() { return sourceIpConfig; } /** *

* The subdomain for your OIDC Identity Provider. *

* * @return The subdomain for your OIDC Identity Provider. */ public final String subDomain() { return subDomain; } /** *

* The configuration of an Amazon Cognito workforce. A single Cognito workforce is created using and corresponds to * a single * Amazon Cognito user pool. *

* * @return The configuration of an Amazon Cognito workforce. A single Cognito workforce is created using and * corresponds to a single Amazon * Cognito user pool. */ public final CognitoConfig cognitoConfig() { return cognitoConfig; } /** *

* The configuration of an OIDC Identity Provider (IdP) private workforce. *

* * @return The configuration of an OIDC Identity Provider (IdP) private workforce. */ public final OidcConfigForResponse oidcConfig() { return oidcConfig; } /** *

* The date that the workforce is created. *

* * @return The date that the workforce is created. */ public final Instant createDate() { return createDate; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(workforceName()); hashCode = 31 * hashCode + Objects.hashCode(workforceArn()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedDate()); hashCode = 31 * hashCode + Objects.hashCode(sourceIpConfig()); hashCode = 31 * hashCode + Objects.hashCode(subDomain()); hashCode = 31 * hashCode + Objects.hashCode(cognitoConfig()); hashCode = 31 * hashCode + Objects.hashCode(oidcConfig()); hashCode = 31 * hashCode + Objects.hashCode(createDate()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Workforce)) { return false; } Workforce other = (Workforce) obj; return Objects.equals(workforceName(), other.workforceName()) && Objects.equals(workforceArn(), other.workforceArn()) && Objects.equals(lastUpdatedDate(), other.lastUpdatedDate()) && Objects.equals(sourceIpConfig(), other.sourceIpConfig()) && Objects.equals(subDomain(), other.subDomain()) && Objects.equals(cognitoConfig(), other.cognitoConfig()) && Objects.equals(oidcConfig(), other.oidcConfig()) && Objects.equals(createDate(), other.createDate()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("Workforce").add("WorkforceName", workforceName()).add("WorkforceArn", workforceArn()) .add("LastUpdatedDate", lastUpdatedDate()).add("SourceIpConfig", sourceIpConfig()).add("SubDomain", subDomain()) .add("CognitoConfig", cognitoConfig()).add("OidcConfig", oidcConfig()).add("CreateDate", createDate()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "WorkforceName": return Optional.ofNullable(clazz.cast(workforceName())); case "WorkforceArn": return Optional.ofNullable(clazz.cast(workforceArn())); case "LastUpdatedDate": return Optional.ofNullable(clazz.cast(lastUpdatedDate())); case "SourceIpConfig": return Optional.ofNullable(clazz.cast(sourceIpConfig())); case "SubDomain": return Optional.ofNullable(clazz.cast(subDomain())); case "CognitoConfig": return Optional.ofNullable(clazz.cast(cognitoConfig())); case "OidcConfig": return Optional.ofNullable(clazz.cast(oidcConfig())); case "CreateDate": return Optional.ofNullable(clazz.cast(createDate())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Workforce) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the private workforce. *

* * @param workforceName * The name of the private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder workforceName(String workforceName); /** *

* The Amazon Resource Name (ARN) of the private workforce. *

* * @param workforceArn * The Amazon Resource Name (ARN) of the private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder workforceArn(String workforceArn); /** *

* The most recent date that was used to successfully add one or more IP address ranges (CIDRs) to a private workforce's * allow list. *

* * @param lastUpdatedDate * The most recent date that was used to successfully add one or more IP address ranges (CIDRs) to a private * workforce's allow list. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedDate(Instant lastUpdatedDate); /** *

* A list of one to ten IP address ranges (CIDRs) to be added to the * workforce allow list. By default, a workforce isn't restricted to specific IP addresses. *

* * @param sourceIpConfig * A list of one to ten IP address ranges (CIDRs) to be added to the * workforce allow list. By default, a workforce isn't restricted to specific IP addresses. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceIpConfig(SourceIpConfig sourceIpConfig); /** *

* A list of one to ten IP address ranges (CIDRs) to be added to the * workforce allow list. By default, a workforce isn't restricted to specific IP addresses. *

* This is a convenience that creates an instance of the {@link SourceIpConfig.Builder} avoiding the need to * create one manually via {@link SourceIpConfig#builder()}. * * When the {@link Consumer} completes, {@link SourceIpConfig.Builder#build()} is called immediately and its * result is passed to {@link #sourceIpConfig(SourceIpConfig)}. * * @param sourceIpConfig * a consumer that will call methods on {@link SourceIpConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sourceIpConfig(SourceIpConfig) */ default Builder sourceIpConfig(Consumer sourceIpConfig) { return sourceIpConfig(SourceIpConfig.builder().applyMutation(sourceIpConfig).build()); } /** *

* The subdomain for your OIDC Identity Provider. *

* * @param subDomain * The subdomain for your OIDC Identity Provider. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subDomain(String subDomain); /** *

* The configuration of an Amazon Cognito workforce. A single Cognito workforce is created using and corresponds * to a single Amazon * Cognito user pool. *

* * @param cognitoConfig * The configuration of an Amazon Cognito workforce. A single Cognito workforce is created using and * corresponds to a single * Amazon Cognito user pool. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cognitoConfig(CognitoConfig cognitoConfig); /** *

* The configuration of an Amazon Cognito workforce. A single Cognito workforce is created using and corresponds * to a single Amazon * Cognito user pool. *

* This is a convenience that creates an instance of the {@link CognitoConfig.Builder} avoiding the need to * create one manually via {@link CognitoConfig#builder()}. * * When the {@link Consumer} completes, {@link CognitoConfig.Builder#build()} is called immediately and its * result is passed to {@link #cognitoConfig(CognitoConfig)}. * * @param cognitoConfig * a consumer that will call methods on {@link CognitoConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #cognitoConfig(CognitoConfig) */ default Builder cognitoConfig(Consumer cognitoConfig) { return cognitoConfig(CognitoConfig.builder().applyMutation(cognitoConfig).build()); } /** *

* The configuration of an OIDC Identity Provider (IdP) private workforce. *

* * @param oidcConfig * The configuration of an OIDC Identity Provider (IdP) private workforce. * @return Returns a reference to this object so that method calls can be chained together. */ Builder oidcConfig(OidcConfigForResponse oidcConfig); /** *

* The configuration of an OIDC Identity Provider (IdP) private workforce. *

* This is a convenience that creates an instance of the {@link OidcConfigForResponse.Builder} avoiding the need * to create one manually via {@link OidcConfigForResponse#builder()}. * * When the {@link Consumer} completes, {@link OidcConfigForResponse.Builder#build()} is called immediately and * its result is passed to {@link #oidcConfig(OidcConfigForResponse)}. * * @param oidcConfig * a consumer that will call methods on {@link OidcConfigForResponse.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #oidcConfig(OidcConfigForResponse) */ default Builder oidcConfig(Consumer oidcConfig) { return oidcConfig(OidcConfigForResponse.builder().applyMutation(oidcConfig).build()); } /** *

* The date that the workforce is created. *

* * @param createDate * The date that the workforce is created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createDate(Instant createDate); } static final class BuilderImpl implements Builder { private String workforceName; private String workforceArn; private Instant lastUpdatedDate; private SourceIpConfig sourceIpConfig; private String subDomain; private CognitoConfig cognitoConfig; private OidcConfigForResponse oidcConfig; private Instant createDate; private BuilderImpl() { } private BuilderImpl(Workforce model) { workforceName(model.workforceName); workforceArn(model.workforceArn); lastUpdatedDate(model.lastUpdatedDate); sourceIpConfig(model.sourceIpConfig); subDomain(model.subDomain); cognitoConfig(model.cognitoConfig); oidcConfig(model.oidcConfig); createDate(model.createDate); } public final String getWorkforceName() { return workforceName; } @Override public final Builder workforceName(String workforceName) { this.workforceName = workforceName; return this; } public final void setWorkforceName(String workforceName) { this.workforceName = workforceName; } public final String getWorkforceArn() { return workforceArn; } @Override public final Builder workforceArn(String workforceArn) { this.workforceArn = workforceArn; return this; } public final void setWorkforceArn(String workforceArn) { this.workforceArn = workforceArn; } public final Instant getLastUpdatedDate() { return lastUpdatedDate; } @Override public final Builder lastUpdatedDate(Instant lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; return this; } public final void setLastUpdatedDate(Instant lastUpdatedDate) { this.lastUpdatedDate = lastUpdatedDate; } public final SourceIpConfig.Builder getSourceIpConfig() { return sourceIpConfig != null ? sourceIpConfig.toBuilder() : null; } @Override public final Builder sourceIpConfig(SourceIpConfig sourceIpConfig) { this.sourceIpConfig = sourceIpConfig; return this; } public final void setSourceIpConfig(SourceIpConfig.BuilderImpl sourceIpConfig) { this.sourceIpConfig = sourceIpConfig != null ? sourceIpConfig.build() : null; } public final String getSubDomain() { return subDomain; } @Override public final Builder subDomain(String subDomain) { this.subDomain = subDomain; return this; } public final void setSubDomain(String subDomain) { this.subDomain = subDomain; } public final CognitoConfig.Builder getCognitoConfig() { return cognitoConfig != null ? cognitoConfig.toBuilder() : null; } @Override public final Builder cognitoConfig(CognitoConfig cognitoConfig) { this.cognitoConfig = cognitoConfig; return this; } public final void setCognitoConfig(CognitoConfig.BuilderImpl cognitoConfig) { this.cognitoConfig = cognitoConfig != null ? cognitoConfig.build() : null; } public final OidcConfigForResponse.Builder getOidcConfig() { return oidcConfig != null ? oidcConfig.toBuilder() : null; } @Override public final Builder oidcConfig(OidcConfigForResponse oidcConfig) { this.oidcConfig = oidcConfig; return this; } public final void setOidcConfig(OidcConfigForResponse.BuilderImpl oidcConfig) { this.oidcConfig = oidcConfig != null ? oidcConfig.build() : null; } public final Instant getCreateDate() { return createDate; } @Override public final Builder createDate(Instant createDate) { this.createDate = createDate; return this; } public final void setCreateDate(Instant createDate) { this.createDate = createDate; } @Override public Workforce build() { return new Workforce(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy