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

software.amazon.awssdk.services.mediaconvert.model.CreateQueueRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Elemental MediaConvert module holds the client classes that are used for communicating with AWS Elemental MediaConvert Service

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.mediaconvert.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.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 CreateQueueRequest extends MediaConvertRequest implements
        ToCopyableBuilder {
    private static final SdkField CONCURRENT_JOBS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("ConcurrentJobs").getter(getter(CreateQueueRequest::concurrentJobs))
            .setter(setter(Builder::concurrentJobs))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("concurrentJobs").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(CreateQueueRequest::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
            .getter(getter(CreateQueueRequest::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField PRICING_PLAN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("PricingPlan").getter(getter(CreateQueueRequest::pricingPlanAsString))
            .setter(setter(Builder::pricingPlan))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pricingPlan").build()).build();

    private static final SdkField RESERVATION_PLAN_SETTINGS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ReservationPlanSettings")
            .getter(getter(CreateQueueRequest::reservationPlanSettings)).setter(setter(Builder::reservationPlanSettings))
            .constructor(ReservationPlanSettings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reservationPlanSettings").build())
            .build();

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

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("Tags")
            .getter(getter(CreateQueueRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONCURRENT_JOBS_FIELD,
            DESCRIPTION_FIELD, NAME_FIELD, PRICING_PLAN_FIELD, RESERVATION_PLAN_SETTINGS_FIELD, STATUS_FIELD, TAGS_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();

    private final Integer concurrentJobs;

    private final String description;

    private final String name;

    private final String pricingPlan;

    private final ReservationPlanSettings reservationPlanSettings;

    private final String status;

    private final Map tags;

    private CreateQueueRequest(BuilderImpl builder) {
        super(builder);
        this.concurrentJobs = builder.concurrentJobs;
        this.description = builder.description;
        this.name = builder.name;
        this.pricingPlan = builder.pricingPlan;
        this.reservationPlanSettings = builder.reservationPlanSettings;
        this.status = builder.status;
        this.tags = builder.tags;
    }

    /**
     * Specify the maximum number of jobs your queue can process concurrently. For on-demand queues, the value you enter
     * is constrained by your service quotas for Maximum concurrent jobs, per on-demand queue and Maximum concurrent
     * jobs, per account. For reserved queues, specify the number of jobs you can process concurrently in your
     * reservation plan instead.
     * 
     * @return Specify the maximum number of jobs your queue can process concurrently. For on-demand queues, the value
     *         you enter is constrained by your service quotas for Maximum concurrent jobs, per on-demand queue and
     *         Maximum concurrent jobs, per account. For reserved queues, specify the number of jobs you can process
     *         concurrently in your reservation plan instead.
     */
    public final Integer concurrentJobs() {
        return concurrentJobs;
    }

    /**
     * Optional. A description of the queue that you are creating.
     * 
     * @return Optional. A description of the queue that you are creating.
     */
    public final String description() {
        return description;
    }

    /**
     * The name of the queue that you are creating.
     * 
     * @return The name of the queue that you are creating.
     */
    public final String name() {
        return name;
    }

    /**
     * Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per minute,
     * billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the entire queue,
     * regardless of how much or how little you use it. Reserved pricing requires a 12-month commitment. When you use
     * the API to create a queue, the default is on-demand.
     * 

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

* * @return Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per * minute, billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the * entire queue, regardless of how much or how little you use it. Reserved pricing requires a 12-month * commitment. When you use the API to create a queue, the default is on-demand. * @see PricingPlan */ public final PricingPlan pricingPlan() { return PricingPlan.fromValue(pricingPlan); } /** * Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per minute, * billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the entire queue, * regardless of how much or how little you use it. Reserved pricing requires a 12-month commitment. When you use * the API to create a queue, the default is on-demand. *

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

* * @return Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per * minute, billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the * entire queue, regardless of how much or how little you use it. Reserved pricing requires a 12-month * commitment. When you use the API to create a queue, the default is on-demand. * @see PricingPlan */ public final String pricingPlanAsString() { return pricingPlan; } /** * Details about the pricing plan for your reserved queue. Required for reserved queues and not applicable to * on-demand queues. * * @return Details about the pricing plan for your reserved queue. Required for reserved queues and not applicable * to on-demand queues. */ public final ReservationPlanSettings reservationPlanSettings() { return reservationPlanSettings; } /** * Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. *

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

* * @return Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. * @see QueueStatus */ public final QueueStatus status() { return QueueStatus.fromValue(status); } /** * Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. *

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

* * @return Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. * @see QueueStatus */ public final String statusAsString() { return status; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** * The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key. *

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a * key. */ public final Map tags() { return tags; } @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(concurrentJobs()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(pricingPlanAsString()); hashCode = 31 * hashCode + Objects.hashCode(reservationPlanSettings()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); 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 CreateQueueRequest)) { return false; } CreateQueueRequest other = (CreateQueueRequest) obj; return Objects.equals(concurrentJobs(), other.concurrentJobs()) && Objects.equals(description(), other.description()) && Objects.equals(name(), other.name()) && Objects.equals(pricingPlanAsString(), other.pricingPlanAsString()) && Objects.equals(reservationPlanSettings(), other.reservationPlanSettings()) && Objects.equals(statusAsString(), other.statusAsString()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * 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("CreateQueueRequest").add("ConcurrentJobs", concurrentJobs()).add("Description", description()) .add("Name", name()).add("PricingPlan", pricingPlanAsString()) .add("ReservationPlanSettings", reservationPlanSettings()).add("Status", statusAsString()) .add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ConcurrentJobs": return Optional.ofNullable(clazz.cast(concurrentJobs())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "PricingPlan": return Optional.ofNullable(clazz.cast(pricingPlanAsString())); case "ReservationPlanSettings": return Optional.ofNullable(clazz.cast(reservationPlanSettings())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("concurrentJobs", CONCURRENT_JOBS_FIELD); map.put("description", DESCRIPTION_FIELD); map.put("name", NAME_FIELD); map.put("pricingPlan", PRICING_PLAN_FIELD); map.put("reservationPlanSettings", RESERVATION_PLAN_SETTINGS_FIELD); map.put("status", STATUS_FIELD); map.put("tags", TAGS_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((CreateQueueRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends MediaConvertRequest.Builder, SdkPojo, CopyableBuilder { /** * Specify the maximum number of jobs your queue can process concurrently. For on-demand queues, the value you * enter is constrained by your service quotas for Maximum concurrent jobs, per on-demand queue and Maximum * concurrent jobs, per account. For reserved queues, specify the number of jobs you can process concurrently in * your reservation plan instead. * * @param concurrentJobs * Specify the maximum number of jobs your queue can process concurrently. For on-demand queues, the * value you enter is constrained by your service quotas for Maximum concurrent jobs, per on-demand queue * and Maximum concurrent jobs, per account. For reserved queues, specify the number of jobs you can * process concurrently in your reservation plan instead. * @return Returns a reference to this object so that method calls can be chained together. */ Builder concurrentJobs(Integer concurrentJobs); /** * Optional. A description of the queue that you are creating. * * @param description * Optional. A description of the queue that you are creating. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** * The name of the queue that you are creating. * * @param name * The name of the queue that you are creating. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** * Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per minute, * billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the entire queue, * regardless of how much or how little you use it. Reserved pricing requires a 12-month commitment. When you * use the API to create a queue, the default is on-demand. * * @param pricingPlan * Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per * minute, billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the * entire queue, regardless of how much or how little you use it. Reserved pricing requires a 12-month * commitment. When you use the API to create a queue, the default is on-demand. * @see PricingPlan * @return Returns a reference to this object so that method calls can be chained together. * @see PricingPlan */ Builder pricingPlan(String pricingPlan); /** * Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per minute, * billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the entire queue, * regardless of how much or how little you use it. Reserved pricing requires a 12-month commitment. When you * use the API to create a queue, the default is on-demand. * * @param pricingPlan * Specifies whether the pricing plan for the queue is on-demand or reserved. For on-demand, you pay per * minute, billed in increments of .01 minute. For reserved, you pay for the transcoding capacity of the * entire queue, regardless of how much or how little you use it. Reserved pricing requires a 12-month * commitment. When you use the API to create a queue, the default is on-demand. * @see PricingPlan * @return Returns a reference to this object so that method calls can be chained together. * @see PricingPlan */ Builder pricingPlan(PricingPlan pricingPlan); /** * Details about the pricing plan for your reserved queue. Required for reserved queues and not applicable to * on-demand queues. * * @param reservationPlanSettings * Details about the pricing plan for your reserved queue. Required for reserved queues and not * applicable to on-demand queues. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reservationPlanSettings(ReservationPlanSettings reservationPlanSettings); /** * Details about the pricing plan for your reserved queue. Required for reserved queues and not applicable to * on-demand queues. This is a convenience method that creates an instance of the * {@link ReservationPlanSettings.Builder} avoiding the need to create one manually via * {@link ReservationPlanSettings#builder()}. * *

* When the {@link Consumer} completes, {@link ReservationPlanSettings.Builder#build()} is called immediately * and its result is passed to {@link #reservationPlanSettings(ReservationPlanSettings)}. * * @param reservationPlanSettings * a consumer that will call methods on {@link ReservationPlanSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #reservationPlanSettings(ReservationPlanSettings) */ default Builder reservationPlanSettings(Consumer reservationPlanSettings) { return reservationPlanSettings(ReservationPlanSettings.builder().applyMutation(reservationPlanSettings).build()); } /** * Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. * * @param status * Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. * @see QueueStatus * @return Returns a reference to this object so that method calls can be chained together. * @see QueueStatus */ Builder status(String status); /** * Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. * * @param status * Initial state of the queue. If you create a paused queue, then jobs in that queue won't begin. * @see QueueStatus * @return Returns a reference to this object so that method calls can be chained together. * @see QueueStatus */ Builder status(QueueStatus status); /** * The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a * key. * * @param tags * The tags that you want to add to the resource. You can tag resources with a key-value pair or with * only a key. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends MediaConvertRequest.BuilderImpl implements Builder { private Integer concurrentJobs; private String description; private String name; private String pricingPlan; private ReservationPlanSettings reservationPlanSettings; private String status; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(CreateQueueRequest model) { super(model); concurrentJobs(model.concurrentJobs); description(model.description); name(model.name); pricingPlan(model.pricingPlan); reservationPlanSettings(model.reservationPlanSettings); status(model.status); tags(model.tags); } public final Integer getConcurrentJobs() { return concurrentJobs; } public final void setConcurrentJobs(Integer concurrentJobs) { this.concurrentJobs = concurrentJobs; } @Override public final Builder concurrentJobs(Integer concurrentJobs) { this.concurrentJobs = concurrentJobs; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getPricingPlan() { return pricingPlan; } public final void setPricingPlan(String pricingPlan) { this.pricingPlan = pricingPlan; } @Override public final Builder pricingPlan(String pricingPlan) { this.pricingPlan = pricingPlan; return this; } @Override public final Builder pricingPlan(PricingPlan pricingPlan) { this.pricingPlan(pricingPlan == null ? null : pricingPlan.toString()); return this; } public final ReservationPlanSettings.Builder getReservationPlanSettings() { return reservationPlanSettings != null ? reservationPlanSettings.toBuilder() : null; } public final void setReservationPlanSettings(ReservationPlanSettings.BuilderImpl reservationPlanSettings) { this.reservationPlanSettings = reservationPlanSettings != null ? reservationPlanSettings.build() : null; } @Override public final Builder reservationPlanSettings(ReservationPlanSettings reservationPlanSettings) { this.reservationPlanSettings = reservationPlanSettings; 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(QueueStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = ___mapOf__stringCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = ___mapOf__stringCopier.copy(tags); return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateQueueRequest build() { return new CreateQueueRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy