software.amazon.awssdk.services.eventbridge.model.CreateConnectionAuthRequestParameters Maven / Gradle / Ivy
Show all versions of eventbridge Show documentation
/*
* 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.eventbridge.model;
import java.io.Serializable;
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;
/**
*
* Contains the authorization parameters for the connection.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateConnectionAuthRequestParameters implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField BASIC_AUTH_PARAMETERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BasicAuthParameters")
.getter(getter(CreateConnectionAuthRequestParameters::basicAuthParameters))
.setter(setter(Builder::basicAuthParameters)).constructor(CreateConnectionBasicAuthRequestParameters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BasicAuthParameters").build())
.build();
private static final SdkField O_AUTH_PARAMETERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("OAuthParameters")
.getter(getter(CreateConnectionAuthRequestParameters::oAuthParameters)).setter(setter(Builder::oAuthParameters))
.constructor(CreateConnectionOAuthRequestParameters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OAuthParameters").build()).build();
private static final SdkField API_KEY_AUTH_PARAMETERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ApiKeyAuthParameters")
.getter(getter(CreateConnectionAuthRequestParameters::apiKeyAuthParameters))
.setter(setter(Builder::apiKeyAuthParameters)).constructor(CreateConnectionApiKeyAuthRequestParameters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApiKeyAuthParameters").build())
.build();
private static final SdkField INVOCATION_HTTP_PARAMETERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("InvocationHttpParameters")
.getter(getter(CreateConnectionAuthRequestParameters::invocationHttpParameters))
.setter(setter(Builder::invocationHttpParameters)).constructor(ConnectionHttpParameters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InvocationHttpParameters").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BASIC_AUTH_PARAMETERS_FIELD,
O_AUTH_PARAMETERS_FIELD, API_KEY_AUTH_PARAMETERS_FIELD, INVOCATION_HTTP_PARAMETERS_FIELD));
private static final long serialVersionUID = 1L;
private final CreateConnectionBasicAuthRequestParameters basicAuthParameters;
private final CreateConnectionOAuthRequestParameters oAuthParameters;
private final CreateConnectionApiKeyAuthRequestParameters apiKeyAuthParameters;
private final ConnectionHttpParameters invocationHttpParameters;
private CreateConnectionAuthRequestParameters(BuilderImpl builder) {
this.basicAuthParameters = builder.basicAuthParameters;
this.oAuthParameters = builder.oAuthParameters;
this.apiKeyAuthParameters = builder.apiKeyAuthParameters;
this.invocationHttpParameters = builder.invocationHttpParameters;
}
/**
*
* A CreateConnectionBasicAuthRequestParameters
object that contains the Basic authorization parameters
* to use for the connection.
*
*
* @return A CreateConnectionBasicAuthRequestParameters
object that contains the Basic authorization
* parameters to use for the connection.
*/
public final CreateConnectionBasicAuthRequestParameters basicAuthParameters() {
return basicAuthParameters;
}
/**
*
* A CreateConnectionOAuthRequestParameters
object that contains the OAuth authorization parameters to
* use for the connection.
*
*
* @return A CreateConnectionOAuthRequestParameters
object that contains the OAuth authorization
* parameters to use for the connection.
*/
public final CreateConnectionOAuthRequestParameters oAuthParameters() {
return oAuthParameters;
}
/**
*
* A CreateConnectionApiKeyAuthRequestParameters
object that contains the API key authorization
* parameters to use for the connection.
*
*
* @return A CreateConnectionApiKeyAuthRequestParameters
object that contains the API key authorization
* parameters to use for the connection.
*/
public final CreateConnectionApiKeyAuthRequestParameters apiKeyAuthParameters() {
return apiKeyAuthParameters;
}
/**
*
* A ConnectionHttpParameters
object that contains the API key authorization parameters to use for the
* connection. Note that if you include additional parameters for the target of a rule via
* HttpParameters
, including query strings, the parameters added for the connection take precedence.
*
*
* @return A ConnectionHttpParameters
object that contains the API key authorization parameters to use
* for the connection. Note that if you include additional parameters for the target of a rule via
* HttpParameters
, including query strings, the parameters added for the connection take
* precedence.
*/
public final ConnectionHttpParameters invocationHttpParameters() {
return invocationHttpParameters;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(basicAuthParameters());
hashCode = 31 * hashCode + Objects.hashCode(oAuthParameters());
hashCode = 31 * hashCode + Objects.hashCode(apiKeyAuthParameters());
hashCode = 31 * hashCode + Objects.hashCode(invocationHttpParameters());
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 CreateConnectionAuthRequestParameters)) {
return false;
}
CreateConnectionAuthRequestParameters other = (CreateConnectionAuthRequestParameters) obj;
return Objects.equals(basicAuthParameters(), other.basicAuthParameters())
&& Objects.equals(oAuthParameters(), other.oAuthParameters())
&& Objects.equals(apiKeyAuthParameters(), other.apiKeyAuthParameters())
&& Objects.equals(invocationHttpParameters(), other.invocationHttpParameters());
}
/**
* 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("CreateConnectionAuthRequestParameters").add("BasicAuthParameters", basicAuthParameters())
.add("OAuthParameters", oAuthParameters()).add("ApiKeyAuthParameters", apiKeyAuthParameters())
.add("InvocationHttpParameters", invocationHttpParameters()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BasicAuthParameters":
return Optional.ofNullable(clazz.cast(basicAuthParameters()));
case "OAuthParameters":
return Optional.ofNullable(clazz.cast(oAuthParameters()));
case "ApiKeyAuthParameters":
return Optional.ofNullable(clazz.cast(apiKeyAuthParameters()));
case "InvocationHttpParameters":
return Optional.ofNullable(clazz.cast(invocationHttpParameters()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function