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

software.amazon.awssdk.services.ivs.model.CreateChannelResponse Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.4
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.ivs.model;

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 CreateChannelResponse extends IvsResponse implements
        ToCopyableBuilder {
    private static final SdkField CHANNEL_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("channel").getter(getter(CreateChannelResponse::channel)).setter(setter(Builder::channel))
            .constructor(Channel::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("channel").build()).build();

    private static final SdkField STREAM_KEY_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("streamKey").getter(getter(CreateChannelResponse::streamKey)).setter(setter(Builder::streamKey))
            .constructor(StreamKey::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("streamKey").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CHANNEL_FIELD,
            STREAM_KEY_FIELD));

    private final Channel channel;

    private final StreamKey streamKey;

    private CreateChannelResponse(BuilderImpl builder) {
        super(builder);
        this.channel = builder.channel;
        this.streamKey = builder.streamKey;
    }

    /**
     * 

* * @return */ public final Channel channel() { return channel; } /** *

* * @return */ public final StreamKey streamKey() { return streamKey; } @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(channel()); hashCode = 31 * hashCode + Objects.hashCode(streamKey()); 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 CreateChannelResponse)) { return false; } CreateChannelResponse other = (CreateChannelResponse) obj; return Objects.equals(channel(), other.channel()) && Objects.equals(streamKey(), other.streamKey()); } /** * 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("CreateChannelResponse").add("Channel", channel()).add("StreamKey", streamKey()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "channel": return Optional.ofNullable(clazz.cast(channel())); case "streamKey": return Optional.ofNullable(clazz.cast(streamKey())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateChannelResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends IvsResponse.Builder, SdkPojo, CopyableBuilder { /** *

* * @param channel * @return Returns a reference to this object so that method calls can be chained together. */ Builder channel(Channel channel); /** *

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

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

* * @param streamKey * @return Returns a reference to this object so that method calls can be chained together. */ Builder streamKey(StreamKey streamKey); /** *

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

* When the {@link Consumer} completes, {@link StreamKey.Builder#build()} is called immediately and its result * is passed to {@link #streamKey(StreamKey)}. * * @param streamKey * a consumer that will call methods on {@link StreamKey.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #streamKey(StreamKey) */ default Builder streamKey(Consumer streamKey) { return streamKey(StreamKey.builder().applyMutation(streamKey).build()); } } static final class BuilderImpl extends IvsResponse.BuilderImpl implements Builder { private Channel channel; private StreamKey streamKey; private BuilderImpl() { } private BuilderImpl(CreateChannelResponse model) { super(model); channel(model.channel); streamKey(model.streamKey); } public final Channel.Builder getChannel() { return channel != null ? channel.toBuilder() : null; } public final void setChannel(Channel.BuilderImpl channel) { this.channel = channel != null ? channel.build() : null; } @Override public final Builder channel(Channel channel) { this.channel = channel; return this; } public final StreamKey.Builder getStreamKey() { return streamKey != null ? streamKey.toBuilder() : null; } public final void setStreamKey(StreamKey.BuilderImpl streamKey) { this.streamKey = streamKey != null ? streamKey.build() : null; } @Override public final Builder streamKey(StreamKey streamKey) { this.streamKey = streamKey; return this; } @Override public CreateChannelResponse build() { return new CreateChannelResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy