com.amazonaws.services.apigateway.model.GetAccountResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-api-gateway Show documentation
/*
 * Copyright 2011-2016 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 com.amazonaws.services.apigateway.model;
import java.io.Serializable;
/**
 * 
 * Represents an AWS account that is associated with Amazon API Gateway.
 * 
 * 
 * 
 * To view the account info, call GET on this resource.
 * 
 * Error Codes
 * 
 * The following exception may be thrown when the request fails.
 * 
 * 
 * - UnauthorizedException
 
 * - NotFoundException
 
 * - TooManyRequestsException
 
 * 
 * 
 * For detailed error code information, including the corresponding HTTP Status Codes, see API Gateway Error
 * Codes
 * 
 * Example: Get the information about an account.
 Request
 * 
 * 
 * GET /account HTTP/1.1 Content-Type: application/json Host: apigateway.us-east-1.amazonaws.com X-Amz-Date: 20160531T184618Z Authorization: AWS4-HMAC-SHA256 Credential={access_key_ID}/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature={sig4_hash} 
 * 
 * 
 * Response
 * 
 * The successful response returns a 200 OK status code and a payload similar to the following:
 * 
 * 
 * 
 * { "_links": { "curies": { "href": "http://docs.aws.amazon.com/apigateway/latest/developerguide/account-apigateway-{rel}.html", "name": "account", "templated": true }, "self": { "href": "/account" }, "account:update": { "href": "/account" } }, "cloudwatchRoleArn": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "throttleSettings": { "rateLimit": 500, "burstLimit": 1000 } } 
 * 
 * 
 * In addition to making the REST API call directly, you can use the AWS CLI and an AWS SDK to access this resource.
 * 
 *  
 */
public class GetAccountResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
    /**
     * 
     * The ARN of an Amazon CloudWatch role for the current Account.
     * 
     */
    private String cloudwatchRoleArn;
    /**
     * 
     * Specifies the API request limits configured for the current Account.
     * 
     */
    private ThrottleSettings throttleSettings;
    /**
     * 
     * A list of features supported for the account. When usage plans are enabled, the features list will include an
     * entry of "UsagePlans".
     * 
     */
    private java.util.List features;
    /**
     * 
     * The version of the API keys used for the account.
     * 
     */
    private String apiKeyVersion;
    /**
     * 
     * The ARN of an Amazon CloudWatch role for the current Account.
     * 
     * 
     * @param cloudwatchRoleArn
     *        The ARN of an Amazon CloudWatch role for the current Account.
     */
    public void setCloudwatchRoleArn(String cloudwatchRoleArn) {
        this.cloudwatchRoleArn = cloudwatchRoleArn;
    }
    /**
     * 
     * The ARN of an Amazon CloudWatch role for the current Account.
     * 
     * 
     * @return The ARN of an Amazon CloudWatch role for the current Account.
     */
    public String getCloudwatchRoleArn() {
        return this.cloudwatchRoleArn;
    }
    /**
     * 
     * The ARN of an Amazon CloudWatch role for the current Account.
     * 
     * 
     * @param cloudwatchRoleArn
     *        The ARN of an Amazon CloudWatch role for the current Account.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public GetAccountResult withCloudwatchRoleArn(String cloudwatchRoleArn) {
        setCloudwatchRoleArn(cloudwatchRoleArn);
        return this;
    }
    /**
     * 
     * Specifies the API request limits configured for the current Account.
     * 
     * 
     * @param throttleSettings
     *        Specifies the API request limits configured for the current Account.
     */
    public void setThrottleSettings(ThrottleSettings throttleSettings) {
        this.throttleSettings = throttleSettings;
    }
    /**
     * 
     * Specifies the API request limits configured for the current Account.
     * 
     * 
     * @return Specifies the API request limits configured for the current Account.
     */
    public ThrottleSettings getThrottleSettings() {
        return this.throttleSettings;
    }
    /**
     * 
     * Specifies the API request limits configured for the current Account.
     * 
     * 
     * @param throttleSettings
     *        Specifies the API request limits configured for the current Account.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public GetAccountResult withThrottleSettings(ThrottleSettings throttleSettings) {
        setThrottleSettings(throttleSettings);
        return this;
    }
    /**
     * 
     * A list of features supported for the account. When usage plans are enabled, the features list will include an
     * entry of "UsagePlans".
     * 
     * 
     * @return A list of features supported for the account. When usage plans are enabled, the features list will
     *         include an entry of "UsagePlans".
     */
    public java.util.List getFeatures() {
        return features;
    }
    /**
     * 
     * A list of features supported for the account. When usage plans are enabled, the features list will include an
     * entry of "UsagePlans".
     * 
     * 
     * @param features
     *        A list of features supported for the account. When usage plans are enabled, the features list will include
     *        an entry of "UsagePlans".
     */
    public void setFeatures(java.util.Collection features) {
        if (features == null) {
            this.features = null;
            return;
        }
        this.features = new java.util.ArrayList(features);
    }
    /**
     * 
     * A list of features supported for the account. When usage plans are enabled, the features list will include an
     * entry of "UsagePlans".
     * 
     * 
     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setFeatures(java.util.Collection)} or {@link #withFeatures(java.util.Collection)} if you want to override
     * the existing values.
     * 
     * 
     * @param features
     *        A list of features supported for the account. When usage plans are enabled, the features list will include
     *        an entry of "UsagePlans".
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public GetAccountResult withFeatures(String... features) {
        if (this.features == null) {
            setFeatures(new java.util.ArrayList(features.length));
        }
        for (String ele : features) {
            this.features.add(ele);
        }
        return this;
    }
    /**
     * 
     * A list of features supported for the account. When usage plans are enabled, the features list will include an
     * entry of "UsagePlans".
     * 
     * 
     * @param features
     *        A list of features supported for the account. When usage plans are enabled, the features list will include
     *        an entry of "UsagePlans".
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public GetAccountResult withFeatures(java.util.Collection features) {
        setFeatures(features);
        return this;
    }
    /**
     * 
     * The version of the API keys used for the account.
     * 
     * 
     * @param apiKeyVersion
     *        The version of the API keys used for the account.
     */
    public void setApiKeyVersion(String apiKeyVersion) {
        this.apiKeyVersion = apiKeyVersion;
    }
    /**
     * 
     * The version of the API keys used for the account.
     * 
     * 
     * @return The version of the API keys used for the account.
     */
    public String getApiKeyVersion() {
        return this.apiKeyVersion;
    }
    /**
     * 
     * The version of the API keys used for the account.
     * 
     * 
     * @param apiKeyVersion
     *        The version of the API keys used for the account.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public GetAccountResult withApiKeyVersion(String apiKeyVersion) {
        setApiKeyVersion(apiKeyVersion);
        return this;
    }
    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCloudwatchRoleArn() != null)
            sb.append("CloudwatchRoleArn: " + getCloudwatchRoleArn() + ",");
        if (getThrottleSettings() != null)
            sb.append("ThrottleSettings: " + getThrottleSettings() + ",");
        if (getFeatures() != null)
            sb.append("Features: " + getFeatures() + ",");
        if (getApiKeyVersion() != null)
            sb.append("ApiKeyVersion: " + getApiKeyVersion());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof GetAccountResult == false)
            return false;
        GetAccountResult other = (GetAccountResult) obj;
        if (other.getCloudwatchRoleArn() == null ^ this.getCloudwatchRoleArn() == null)
            return false;
        if (other.getCloudwatchRoleArn() != null && other.getCloudwatchRoleArn().equals(this.getCloudwatchRoleArn()) == false)
            return false;
        if (other.getThrottleSettings() == null ^ this.getThrottleSettings() == null)
            return false;
        if (other.getThrottleSettings() != null && other.getThrottleSettings().equals(this.getThrottleSettings()) == false)
            return false;
        if (other.getFeatures() == null ^ this.getFeatures() == null)
            return false;
        if (other.getFeatures() != null && other.getFeatures().equals(this.getFeatures()) == false)
            return false;
        if (other.getApiKeyVersion() == null ^ this.getApiKeyVersion() == null)
            return false;
        if (other.getApiKeyVersion() != null && other.getApiKeyVersion().equals(this.getApiKeyVersion()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getCloudwatchRoleArn() == null) ? 0 : getCloudwatchRoleArn().hashCode());
        hashCode = prime * hashCode + ((getThrottleSettings() == null) ? 0 : getThrottleSettings().hashCode());
        hashCode = prime * hashCode + ((getFeatures() == null) ? 0 : getFeatures().hashCode());
        hashCode = prime * hashCode + ((getApiKeyVersion() == null) ? 0 : getApiKeyVersion().hashCode());
        return hashCode;
    }
    @Override
    public GetAccountResult clone() {
        try {
            return (GetAccountResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }
}