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

software.amazon.awssdk.services.m2.model.GetBatchJobExecutionResponse Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.30.1
Show 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.m2.model;

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;

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

    private static final SdkField BATCH_JOB_IDENTIFIER_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("batchJobIdentifier")
            .getter(getter(GetBatchJobExecutionResponse::batchJobIdentifier)).setter(setter(Builder::batchJobIdentifier))
            .constructor(BatchJobIdentifier::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("batchJobIdentifier").build())
            .build();

    private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("endTime").getter(getter(GetBatchJobExecutionResponse::endTime)).setter(setter(Builder::endTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("endTime").build()).build();

    private static final SdkField EXECUTION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("executionId").getter(getter(GetBatchJobExecutionResponse::executionId))
            .setter(setter(Builder::executionId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("executionId").build()).build();

    private static final SdkField JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("jobId")
            .getter(getter(GetBatchJobExecutionResponse::jobId)).setter(setter(Builder::jobId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobId").build()).build();

    private static final SdkField JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("jobName").getter(getter(GetBatchJobExecutionResponse::jobName)).setter(setter(Builder::jobName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobName").build()).build();

    private static final SdkField JOB_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("jobType").getter(getter(GetBatchJobExecutionResponse::jobTypeAsString)).setter(setter(Builder::jobType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobType").build()).build();

    private static final SdkField JOB_USER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("jobUser").getter(getter(GetBatchJobExecutionResponse::jobUser)).setter(setter(Builder::jobUser))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobUser").build()).build();

    private static final SdkField RETURN_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("returnCode").getter(getter(GetBatchJobExecutionResponse::returnCode))
            .setter(setter(Builder::returnCode))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("returnCode").build()).build();

    private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("startTime").getter(getter(GetBatchJobExecutionResponse::startTime)).setter(setter(Builder::startTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build();

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

    private static final SdkField STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("statusReason").getter(getter(GetBatchJobExecutionResponse::statusReason))
            .setter(setter(Builder::statusReason))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusReason").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_ID_FIELD,
            BATCH_JOB_IDENTIFIER_FIELD, END_TIME_FIELD, EXECUTION_ID_FIELD, JOB_ID_FIELD, JOB_NAME_FIELD, JOB_TYPE_FIELD,
            JOB_USER_FIELD, RETURN_CODE_FIELD, START_TIME_FIELD, STATUS_FIELD, STATUS_REASON_FIELD));

    private final String applicationId;

    private final BatchJobIdentifier batchJobIdentifier;

    private final Instant endTime;

    private final String executionId;

    private final String jobId;

    private final String jobName;

    private final String jobType;

    private final String jobUser;

    private final String returnCode;

    private final Instant startTime;

    private final String status;

    private final String statusReason;

    private GetBatchJobExecutionResponse(BuilderImpl builder) {
        super(builder);
        this.applicationId = builder.applicationId;
        this.batchJobIdentifier = builder.batchJobIdentifier;
        this.endTime = builder.endTime;
        this.executionId = builder.executionId;
        this.jobId = builder.jobId;
        this.jobName = builder.jobName;
        this.jobType = builder.jobType;
        this.jobUser = builder.jobUser;
        this.returnCode = builder.returnCode;
        this.startTime = builder.startTime;
        this.status = builder.status;
        this.statusReason = builder.statusReason;
    }

    /**
     * 

* The identifier of the application. *

* * @return The identifier of the application. */ public final String applicationId() { return applicationId; } /** *

* The unique identifier of this batch job. *

* * @return The unique identifier of this batch job. */ public final BatchJobIdentifier batchJobIdentifier() { return batchJobIdentifier; } /** *

* The timestamp when the batch job execution ended. *

* * @return The timestamp when the batch job execution ended. */ public final Instant endTime() { return endTime; } /** *

* The unique identifier for this batch job execution. *

* * @return The unique identifier for this batch job execution. */ public final String executionId() { return executionId; } /** *

* The unique identifier for this batch job. *

* * @return The unique identifier for this batch job. */ public final String jobId() { return jobId; } /** *

* The name of this batch job. *

* * @return The name of this batch job. */ public final String jobName() { return jobName; } /** *

* The type of job. *

*

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

* * @return The type of job. * @see BatchJobType */ public final BatchJobType jobType() { return BatchJobType.fromValue(jobType); } /** *

* The type of job. *

*

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

* * @return The type of job. * @see BatchJobType */ public final String jobTypeAsString() { return jobType; } /** *

* The user for the job. *

* * @return The user for the job. */ public final String jobUser() { return jobUser; } /** *

* The batch job return code from either the Blu Age or Micro Focus runtime engines. For more information, see Batch return codes in the IBM * WebSphere Application Server documentation. *

* * @return The batch job return code from either the Blu Age or Micro Focus runtime engines. For more information, * see Batch return codes * in the IBM WebSphere Application Server documentation. */ public final String returnCode() { return returnCode; } /** *

* The timestamp when the batch job execution started. *

* * @return The timestamp when the batch job execution started. */ public final Instant startTime() { return startTime; } /** *

* The status of the batch job execution. *

*

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

* * @return The status of the batch job execution. * @see BatchJobExecutionStatus */ public final BatchJobExecutionStatus status() { return BatchJobExecutionStatus.fromValue(status); } /** *

* The status of the batch job execution. *

*

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

* * @return The status of the batch job execution. * @see BatchJobExecutionStatus */ public final String statusAsString() { return status; } /** *

* The reason for the reported status. *

* * @return The reason for the reported status. */ public final String statusReason() { return statusReason; } @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(applicationId()); hashCode = 31 * hashCode + Objects.hashCode(batchJobIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(executionId()); hashCode = 31 * hashCode + Objects.hashCode(jobId()); hashCode = 31 * hashCode + Objects.hashCode(jobName()); hashCode = 31 * hashCode + Objects.hashCode(jobTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(jobUser()); hashCode = 31 * hashCode + Objects.hashCode(returnCode()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusReason()); 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 GetBatchJobExecutionResponse)) { return false; } GetBatchJobExecutionResponse other = (GetBatchJobExecutionResponse) obj; return Objects.equals(applicationId(), other.applicationId()) && Objects.equals(batchJobIdentifier(), other.batchJobIdentifier()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(executionId(), other.executionId()) && Objects.equals(jobId(), other.jobId()) && Objects.equals(jobName(), other.jobName()) && Objects.equals(jobTypeAsString(), other.jobTypeAsString()) && Objects.equals(jobUser(), other.jobUser()) && Objects.equals(returnCode(), other.returnCode()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusReason(), other.statusReason()); } /** * 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("GetBatchJobExecutionResponse").add("ApplicationId", applicationId()) .add("BatchJobIdentifier", batchJobIdentifier()).add("EndTime", endTime()).add("ExecutionId", executionId()) .add("JobId", jobId()).add("JobName", jobName()).add("JobType", jobTypeAsString()).add("JobUser", jobUser()) .add("ReturnCode", returnCode()).add("StartTime", startTime()).add("Status", statusAsString()) .add("StatusReason", statusReason()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "applicationId": return Optional.ofNullable(clazz.cast(applicationId())); case "batchJobIdentifier": return Optional.ofNullable(clazz.cast(batchJobIdentifier())); case "endTime": return Optional.ofNullable(clazz.cast(endTime())); case "executionId": return Optional.ofNullable(clazz.cast(executionId())); case "jobId": return Optional.ofNullable(clazz.cast(jobId())); case "jobName": return Optional.ofNullable(clazz.cast(jobName())); case "jobType": return Optional.ofNullable(clazz.cast(jobTypeAsString())); case "jobUser": return Optional.ofNullable(clazz.cast(jobUser())); case "returnCode": return Optional.ofNullable(clazz.cast(returnCode())); case "startTime": return Optional.ofNullable(clazz.cast(startTime())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "statusReason": return Optional.ofNullable(clazz.cast(statusReason())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetBatchJobExecutionResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends M2Response.Builder, SdkPojo, CopyableBuilder { /** *

* The identifier of the application. *

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

* The unique identifier of this batch job. *

* * @param batchJobIdentifier * The unique identifier of this batch job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder batchJobIdentifier(BatchJobIdentifier batchJobIdentifier); /** *

* The unique identifier of this batch job. *

* This is a convenience method that creates an instance of the {@link BatchJobIdentifier.Builder} avoiding the * need to create one manually via {@link BatchJobIdentifier#builder()}. * *

* When the {@link Consumer} completes, {@link BatchJobIdentifier.Builder#build()} is called immediately and its * result is passed to {@link #batchJobIdentifier(BatchJobIdentifier)}. * * @param batchJobIdentifier * a consumer that will call methods on {@link BatchJobIdentifier.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #batchJobIdentifier(BatchJobIdentifier) */ default Builder batchJobIdentifier(Consumer batchJobIdentifier) { return batchJobIdentifier(BatchJobIdentifier.builder().applyMutation(batchJobIdentifier).build()); } /** *

* The timestamp when the batch job execution ended. *

* * @param endTime * The timestamp when the batch job execution ended. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

* The unique identifier for this batch job execution. *

* * @param executionId * The unique identifier for this batch job execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder executionId(String executionId); /** *

* The unique identifier for this batch job. *

* * @param jobId * The unique identifier for this batch job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobId(String jobId); /** *

* The name of this batch job. *

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

* The type of job. *

* * @param jobType * The type of job. * @see BatchJobType * @return Returns a reference to this object so that method calls can be chained together. * @see BatchJobType */ Builder jobType(String jobType); /** *

* The type of job. *

* * @param jobType * The type of job. * @see BatchJobType * @return Returns a reference to this object so that method calls can be chained together. * @see BatchJobType */ Builder jobType(BatchJobType jobType); /** *

* The user for the job. *

* * @param jobUser * The user for the job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobUser(String jobUser); /** *

* The batch job return code from either the Blu Age or Micro Focus runtime engines. For more information, see * Batch return codes in the * IBM WebSphere Application Server documentation. *

* * @param returnCode * The batch job return code from either the Blu Age or Micro Focus runtime engines. For more * information, see Batch * return codes in the IBM WebSphere Application Server documentation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder returnCode(String returnCode); /** *

* The timestamp when the batch job execution started. *

* * @param startTime * The timestamp when the batch job execution started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The status of the batch job execution. *

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

* The status of the batch job execution. *

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

* The reason for the reported status. *

* * @param statusReason * The reason for the reported status. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusReason(String statusReason); } static final class BuilderImpl extends M2Response.BuilderImpl implements Builder { private String applicationId; private BatchJobIdentifier batchJobIdentifier; private Instant endTime; private String executionId; private String jobId; private String jobName; private String jobType; private String jobUser; private String returnCode; private Instant startTime; private String status; private String statusReason; private BuilderImpl() { } private BuilderImpl(GetBatchJobExecutionResponse model) { super(model); applicationId(model.applicationId); batchJobIdentifier(model.batchJobIdentifier); endTime(model.endTime); executionId(model.executionId); jobId(model.jobId); jobName(model.jobName); jobType(model.jobType); jobUser(model.jobUser); returnCode(model.returnCode); startTime(model.startTime); status(model.status); statusReason(model.statusReason); } public final String getApplicationId() { return applicationId; } public final void setApplicationId(String applicationId) { this.applicationId = applicationId; } @Override public final Builder applicationId(String applicationId) { this.applicationId = applicationId; return this; } public final BatchJobIdentifier.Builder getBatchJobIdentifier() { return batchJobIdentifier != null ? batchJobIdentifier.toBuilder() : null; } public final void setBatchJobIdentifier(BatchJobIdentifier.BuilderImpl batchJobIdentifier) { this.batchJobIdentifier = batchJobIdentifier != null ? batchJobIdentifier.build() : null; } @Override public final Builder batchJobIdentifier(BatchJobIdentifier batchJobIdentifier) { this.batchJobIdentifier = batchJobIdentifier; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final String getExecutionId() { return executionId; } public final void setExecutionId(String executionId) { this.executionId = executionId; } @Override public final Builder executionId(String executionId) { this.executionId = executionId; return this; } public final String getJobId() { return jobId; } public final void setJobId(String jobId) { this.jobId = jobId; } @Override public final Builder jobId(String jobId) { this.jobId = jobId; return this; } public final String getJobName() { return jobName; } public final void setJobName(String jobName) { this.jobName = jobName; } @Override public final Builder jobName(String jobName) { this.jobName = jobName; return this; } public final String getJobType() { return jobType; } public final void setJobType(String jobType) { this.jobType = jobType; } @Override public final Builder jobType(String jobType) { this.jobType = jobType; return this; } @Override public final Builder jobType(BatchJobType jobType) { this.jobType(jobType == null ? null : jobType.toString()); return this; } public final String getJobUser() { return jobUser; } public final void setJobUser(String jobUser) { this.jobUser = jobUser; } @Override public final Builder jobUser(String jobUser) { this.jobUser = jobUser; return this; } public final String getReturnCode() { return returnCode; } public final void setReturnCode(String returnCode) { this.returnCode = returnCode; } @Override public final Builder returnCode(String returnCode) { this.returnCode = returnCode; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; 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(BatchJobExecutionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusReason() { return statusReason; } public final void setStatusReason(String statusReason) { this.statusReason = statusReason; } @Override public final Builder statusReason(String statusReason) { this.statusReason = statusReason; return this; } @Override public GetBatchJobExecutionResponse build() { return new GetBatchJobExecutionResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy