@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(generateDistinctId()); hashCode = 31 * hashCode + Objects.hashCode(value()); hashCode = 31 * hashCode + Objects.hashCode(stageKeys()); hashCode = 31 * hashCode + Objects.hashCode(customerId()); return hashCode; }
@Override public CreateApiKeyRequest build() { return new CreateApiKeyRequest(this); }
return createApiKey(CreateApiKeyRequest.builder().build());
throws UnauthorizedException, NotFoundException, TooManyRequestsException, LimitExceededException, BadRequestException, ConflictException, AwsServiceException, SdkClientException, ApiGatewayException { return createApiKey(CreateApiKeyRequest.builder().applyMutation(createApiKeyRequest).build());
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateApiKeyRequest)) { return false; } CreateApiKeyRequest other = (CreateApiKeyRequest) obj; return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(enabled(), other.enabled()) && Objects.equals(generateDistinctId(), other.generateDistinctId()) && Objects.equals(value(), other.value()) && Objects.equals(stageKeys(), other.stageKeys()) && Objects.equals(customerId(), other.customerId()); }
return createApiKey(CreateApiKeyRequest.builder().applyMutation(createApiKeyRequest).build());
/** * 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("CreateApiKeyRequest").add("Name", name()).add("Description", description()) .add("Enabled", enabled()).add("GenerateDistinctId", generateDistinctId()).add("Value", value()) .add("StageKeys", stageKeys()).add("CustomerId", customerId()).build(); }
return createApiKey(CreateApiKeyRequest.builder().applyMutation(createApiKeyRequest).build());
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "enabled": return Optional.ofNullable(clazz.cast(enabled())); case "generateDistinctId": return Optional.ofNullable(clazz.cast(generateDistinctId())); case "value": return Optional.ofNullable(clazz.cast(value())); case "stageKeys": return Optional.ofNullable(clazz.cast(stageKeys())); case "customerId": return Optional.ofNullable(clazz.cast(customerId())); default: return Optional.empty(); } }
/** * Marshall the given parameter object */ public void marshall(CreateApiKeyRequest createApiKeyRequest, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(createApiKeyRequest, "createApiKeyRequest"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(createApiKeyRequest.name(), NAME_BINDING); protocolMarshaller.marshall(createApiKeyRequest.description(), DESCRIPTION_BINDING); protocolMarshaller.marshall(createApiKeyRequest.enabled(), ENABLED_BINDING); protocolMarshaller.marshall(createApiKeyRequest.generateDistinctId(), GENERATEDISTINCTID_BINDING); protocolMarshaller.marshall(createApiKeyRequest.value(), VALUE_BINDING); protocolMarshaller.marshall(createApiKeyRequest.stageKeys(), STAGEKEYS_BINDING); protocolMarshaller.marshall(createApiKeyRequest.customerId(), CUSTOMERID_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }