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

software.amazon.awssdk.services.amplifybackend.model.GetBackendApiModelsResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amplify Backend module holds the client classes that are used for communicating with Amplify Backend.

The newest version!
/*
 * 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.amplifybackend.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class GetBackendApiModelsResponse extends AmplifyBackendResponse implements
        ToCopyableBuilder {
    private static final SdkField MODELS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Models")
            .getter(getter(GetBackendApiModelsResponse::models)).setter(setter(Builder::models))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("models").build()).build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
            .getter(getter(GetBackendApiModelsResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();

    private static final SdkField MODEL_INTROSPECTION_SCHEMA_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ModelIntrospectionSchema").getter(getter(GetBackendApiModelsResponse::modelIntrospectionSchema))
            .setter(setter(Builder::modelIntrospectionSchema))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modelIntrospectionSchema").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MODELS_FIELD, STATUS_FIELD,
            MODEL_INTROSPECTION_SCHEMA_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("models", MODELS_FIELD);
                    put("status", STATUS_FIELD);
                    put("modelIntrospectionSchema", MODEL_INTROSPECTION_SCHEMA_FIELD);
                }
            });

    private final String models;

    private final String status;

    private final String modelIntrospectionSchema;

    private GetBackendApiModelsResponse(BuilderImpl builder) {
        super(builder);
        this.models = builder.models;
        this.status = builder.status;
        this.modelIntrospectionSchema = builder.modelIntrospectionSchema;
    }

    /**
     * 

* Stringified JSON of the datastore model. *

* * @return Stringified JSON of the datastore model. */ public final String models() { return models; } /** *

* The current status of the request. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link Status#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The current status of the request. * @see Status */ public final Status status() { return Status.fromValue(status); } /** *

* The current status of the request. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link Status#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #statusAsString}. *

* * @return The current status of the request. * @see Status */ public final String statusAsString() { return status; } /** *

* Stringified JSON of the model introspection schema for an existing backend API resource. *

* * @return Stringified JSON of the model introspection schema for an existing backend API resource. */ public final String modelIntrospectionSchema() { return modelIntrospectionSchema; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(models()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(modelIntrospectionSchema()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof GetBackendApiModelsResponse)) { return false; } GetBackendApiModelsResponse other = (GetBackendApiModelsResponse) obj; return Objects.equals(models(), other.models()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(modelIntrospectionSchema(), other.modelIntrospectionSchema()); } /** * 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("GetBackendApiModelsResponse").add("Models", models()).add("Status", statusAsString()) .add("ModelIntrospectionSchema", modelIntrospectionSchema()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Models": return Optional.ofNullable(clazz.cast(models())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "ModelIntrospectionSchema": return Optional.ofNullable(clazz.cast(modelIntrospectionSchema())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((GetBackendApiModelsResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends AmplifyBackendResponse.Builder, SdkPojo, CopyableBuilder { /** *

* Stringified JSON of the datastore model. *

* * @param models * Stringified JSON of the datastore model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder models(String models); /** *

* The current status of the request. *

* * @param status * The current status of the request. * @see Status * @return Returns a reference to this object so that method calls can be chained together. * @see Status */ Builder status(String status); /** *

* The current status of the request. *

* * @param status * The current status of the request. * @see Status * @return Returns a reference to this object so that method calls can be chained together. * @see Status */ Builder status(Status status); /** *

* Stringified JSON of the model introspection schema for an existing backend API resource. *

* * @param modelIntrospectionSchema * Stringified JSON of the model introspection schema for an existing backend API resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelIntrospectionSchema(String modelIntrospectionSchema); } static final class BuilderImpl extends AmplifyBackendResponse.BuilderImpl implements Builder { private String models; private String status; private String modelIntrospectionSchema; private BuilderImpl() { } private BuilderImpl(GetBackendApiModelsResponse model) { super(model); models(model.models); status(model.status); modelIntrospectionSchema(model.modelIntrospectionSchema); } public final String getModels() { return models; } public final void setModels(String models) { this.models = models; } @Override public final Builder models(String models) { this.models = models; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(Status status) { this.status(status == null ? null : status.toString()); return this; } public final String getModelIntrospectionSchema() { return modelIntrospectionSchema; } public final void setModelIntrospectionSchema(String modelIntrospectionSchema) { this.modelIntrospectionSchema = modelIntrospectionSchema; } @Override public final Builder modelIntrospectionSchema(String modelIntrospectionSchema) { this.modelIntrospectionSchema = modelIntrospectionSchema; return this; } @Override public GetBackendApiModelsResponse build() { return new GetBackendApiModelsResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy