software.amazon.awssdk.services.devicefarm.model.GetDevicePoolCompatibilityRequest Maven / Gradle / Ivy
/*
* 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.devicefarm.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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents a request to the get device pool compatibility operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetDevicePoolCompatibilityRequest extends DeviceFarmRequest implements
ToCopyableBuilder {
private static final SdkField DEVICE_POOL_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetDevicePoolCompatibilityRequest::devicePoolArn)).setter(setter(Builder::devicePoolArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("devicePoolArn").build()).build();
private static final SdkField APP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetDevicePoolCompatibilityRequest::appArn)).setter(setter(Builder::appArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("appArn").build()).build();
private static final SdkField TEST_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetDevicePoolCompatibilityRequest::testTypeAsString)).setter(setter(Builder::testType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("testType").build()).build();
private static final SdkField TEST_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(GetDevicePoolCompatibilityRequest::test)).setter(setter(Builder::test))
.constructor(ScheduleRunTest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("test").build()).build();
private static final SdkField CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(GetDevicePoolCompatibilityRequest::configuration)).setter(setter(Builder::configuration))
.constructor(ScheduleRunConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("configuration").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DEVICE_POOL_ARN_FIELD,
APP_ARN_FIELD, TEST_TYPE_FIELD, TEST_FIELD, CONFIGURATION_FIELD));
private final String devicePoolArn;
private final String appArn;
private final String testType;
private final ScheduleRunTest test;
private final ScheduleRunConfiguration configuration;
private GetDevicePoolCompatibilityRequest(BuilderImpl builder) {
super(builder);
this.devicePoolArn = builder.devicePoolArn;
this.appArn = builder.appArn;
this.testType = builder.testType;
this.test = builder.test;
this.configuration = builder.configuration;
}
/**
*
* The device pool's ARN.
*
*
* @return The device pool's ARN.
*/
public String devicePoolArn() {
return devicePoolArn;
}
/**
*
* The ARN of the app that is associated with the specified device pool.
*
*
* @return The ARN of the app that is associated with the specified device pool.
*/
public String appArn() {
return appArn;
}
/**
*
* The test type for the specified device pool.
*
*
* Allowed values include the following:
*
*
* -
*
* BUILTIN_FUZZ.
*
*
* -
*
* BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android app, interacting with it and capturing
* screenshots at the same time.
*
*
* -
*
* APPIUM_JAVA_JUNIT.
*
*
* -
*
* APPIUM_JAVA_TESTNG.
*
*
* -
*
* APPIUM_PYTHON.
*
*
* -
*
* APPIUM_NODE.
*
*
* -
*
* APPIUM_RUBY.
*
*
* -
*
* APPIUM_WEB_JAVA_JUNIT.
*
*
* -
*
* APPIUM_WEB_JAVA_TESTNG.
*
*
* -
*
* APPIUM_WEB_PYTHON.
*
*
* -
*
* APPIUM_WEB_NODE.
*
*
* -
*
* APPIUM_WEB_RUBY.
*
*
* -
*
* CALABASH.
*
*
* -
*
* INSTRUMENTATION.
*
*
* -
*
* UIAUTOMATION.
*
*
* -
*
* UIAUTOMATOR.
*
*
* -
*
* XCTEST.
*
*
* -
*
* XCTEST_UI.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #testType} will
* return {@link TestType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #testTypeAsString}.
*
*
* @return The test type for the specified device pool.
*
* Allowed values include the following:
*
*
* -
*
* BUILTIN_FUZZ.
*
*
* -
*
* BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android app, interacting with it and
* capturing screenshots at the same time.
*
*
* -
*
* APPIUM_JAVA_JUNIT.
*
*
* -
*
* APPIUM_JAVA_TESTNG.
*
*
* -
*
* APPIUM_PYTHON.
*
*
* -
*
* APPIUM_NODE.
*
*
* -
*
* APPIUM_RUBY.
*
*
* -
*
* APPIUM_WEB_JAVA_JUNIT.
*
*
* -
*
* APPIUM_WEB_JAVA_TESTNG.
*
*
* -
*
* APPIUM_WEB_PYTHON.
*
*
* -
*
* APPIUM_WEB_NODE.
*
*
* -
*
* APPIUM_WEB_RUBY.
*
*
* -
*
* CALABASH.
*
*
* -
*
* INSTRUMENTATION.
*
*
* -
*
* UIAUTOMATION.
*
*
* -
*
* UIAUTOMATOR.
*
*
* -
*
* XCTEST.
*
*
* -
*
* XCTEST_UI.
*
*
* @see TestType
*/
public TestType testType() {
return TestType.fromValue(testType);
}
/**
*
* The test type for the specified device pool.
*
*
* Allowed values include the following:
*
*
* -
*
* BUILTIN_FUZZ.
*
*
* -
*
* BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android app, interacting with it and capturing
* screenshots at the same time.
*
*
* -
*
* APPIUM_JAVA_JUNIT.
*
*
* -
*
* APPIUM_JAVA_TESTNG.
*
*
* -
*
* APPIUM_PYTHON.
*
*
* -
*
* APPIUM_NODE.
*
*
* -
*
* APPIUM_RUBY.
*
*
* -
*
* APPIUM_WEB_JAVA_JUNIT.
*
*
* -
*
* APPIUM_WEB_JAVA_TESTNG.
*
*
* -
*
* APPIUM_WEB_PYTHON.
*
*
* -
*
* APPIUM_WEB_NODE.
*
*
* -
*
* APPIUM_WEB_RUBY.
*
*
* -
*
* CALABASH.
*
*
* -
*
* INSTRUMENTATION.
*
*
* -
*
* UIAUTOMATION.
*
*
* -
*
* UIAUTOMATOR.
*
*
* -
*
* XCTEST.
*
*
* -
*
* XCTEST_UI.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #testType} will
* return {@link TestType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #testTypeAsString}.
*
*
* @return The test type for the specified device pool.
*
* Allowed values include the following:
*
*
* -
*
* BUILTIN_FUZZ.
*
*
* -
*
* BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android app, interacting with it and
* capturing screenshots at the same time.
*
*
* -
*
* APPIUM_JAVA_JUNIT.
*
*
* -
*
* APPIUM_JAVA_TESTNG.
*
*
* -
*
* APPIUM_PYTHON.
*
*
* -
*
* APPIUM_NODE.
*
*
* -
*
* APPIUM_RUBY.
*
*
* -
*
* APPIUM_WEB_JAVA_JUNIT.
*
*
* -
*
* APPIUM_WEB_JAVA_TESTNG.
*
*
* -
*
* APPIUM_WEB_PYTHON.
*
*
* -
*
* APPIUM_WEB_NODE.
*
*
* -
*
* APPIUM_WEB_RUBY.
*
*
* -
*
* CALABASH.
*
*
* -
*
* INSTRUMENTATION.
*
*
* -
*
* UIAUTOMATION.
*
*
* -
*
* UIAUTOMATOR.
*
*
* -
*
* XCTEST.
*
*
* -
*
* XCTEST_UI.
*
*
* @see TestType
*/
public String testTypeAsString() {
return testType;
}
/**
*
* Information about the uploaded test to be run against the device pool.
*
*
* @return Information about the uploaded test to be run against the device pool.
*/
public ScheduleRunTest test() {
return test;
}
/**
*
* An object that contains information about the settings for a run.
*
*
* @return An object that contains information about the settings for a run.
*/
public ScheduleRunConfiguration configuration() {
return configuration;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(devicePoolArn());
hashCode = 31 * hashCode + Objects.hashCode(appArn());
hashCode = 31 * hashCode + Objects.hashCode(testTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(test());
hashCode = 31 * hashCode + Objects.hashCode(configuration());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetDevicePoolCompatibilityRequest)) {
return false;
}
GetDevicePoolCompatibilityRequest other = (GetDevicePoolCompatibilityRequest) obj;
return Objects.equals(devicePoolArn(), other.devicePoolArn()) && Objects.equals(appArn(), other.appArn())
&& Objects.equals(testTypeAsString(), other.testTypeAsString()) && Objects.equals(test(), other.test())
&& Objects.equals(configuration(), other.configuration());
}
/**
* 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 String toString() {
return ToString.builder("GetDevicePoolCompatibilityRequest").add("DevicePoolArn", devicePoolArn())
.add("AppArn", appArn()).add("TestType", testTypeAsString()).add("Test", test())
.add("Configuration", configuration()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "devicePoolArn":
return Optional.ofNullable(clazz.cast(devicePoolArn()));
case "appArn":
return Optional.ofNullable(clazz.cast(appArn()));
case "testType":
return Optional.ofNullable(clazz.cast(testTypeAsString()));
case "test":
return Optional.ofNullable(clazz.cast(test()));
case "configuration":
return Optional.ofNullable(clazz.cast(configuration()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function