/* * Copyright 2018-2023 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.chime.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SearchAvailablePhoneNumbersRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The area code used to filter results. Only applies to the US. *
*/ private String areaCode; /** ** The city used to filter results. Only applies to the US. *
*/ private String city; /** ** The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2. *
*/ private String country; /** *
* The state used to filter results. Required only if you provide City
. Only applies to the US.
*
* The toll-free prefix that you use to filter results. Only applies to the US. *
*/ private String tollFreePrefix; /** ** The phone number type used to filter results. Required for non-US numbers. *
*/ private String phoneNumberType; /** ** The maximum number of results to return in a single call. *
*/ private Integer maxResults; /** ** The token used to retrieve the next page of results. *
*/ private String nextToken; /** ** The area code used to filter results. Only applies to the US. *
* * @param areaCode * The area code used to filter results. Only applies to the US. */ public void setAreaCode(String areaCode) { this.areaCode = areaCode; } /** ** The area code used to filter results. Only applies to the US. *
* * @return The area code used to filter results. Only applies to the US. */ public String getAreaCode() { return this.areaCode; } /** ** The area code used to filter results. Only applies to the US. *
* * @param areaCode * The area code used to filter results. Only applies to the US. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchAvailablePhoneNumbersRequest withAreaCode(String areaCode) { setAreaCode(areaCode); return this; } /** ** The city used to filter results. Only applies to the US. *
* * @param city * The city used to filter results. Only applies to the US. */ public void setCity(String city) { this.city = city; } /** ** The city used to filter results. Only applies to the US. *
* * @return The city used to filter results. Only applies to the US. */ public String getCity() { return this.city; } /** ** The city used to filter results. Only applies to the US. *
* * @param city * The city used to filter results. Only applies to the US. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchAvailablePhoneNumbersRequest withCity(String city) { setCity(city); return this; } /** ** The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2. *
* * @param country * The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2. */ public void setCountry(String country) { this.country = country; } /** ** The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2. *
* * @return The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2. */ public String getCountry() { return this.country; } /** ** The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2. *
* * @param country * The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchAvailablePhoneNumbersRequest withCountry(String country) { setCountry(country); return this; } /** *
* The state used to filter results. Required only if you provide City
. Only applies to the US.
*
City
. Only applies to the US.
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state used to filter results. Required only if you provide City
. Only applies to the US.
*
City
. Only applies to the US.
*/
public String getState() {
return this.state;
}
/**
*
* The state used to filter results. Required only if you provide City
. Only applies to the US.
*
City
. Only applies to the US.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchAvailablePhoneNumbersRequest withState(String state) {
setState(state);
return this;
}
/**
* * The toll-free prefix that you use to filter results. Only applies to the US. *
* * @param tollFreePrefix * The toll-free prefix that you use to filter results. Only applies to the US. */ public void setTollFreePrefix(String tollFreePrefix) { this.tollFreePrefix = tollFreePrefix; } /** ** The toll-free prefix that you use to filter results. Only applies to the US. *
* * @return The toll-free prefix that you use to filter results. Only applies to the US. */ public String getTollFreePrefix() { return this.tollFreePrefix; } /** ** The toll-free prefix that you use to filter results. Only applies to the US. *
* * @param tollFreePrefix * The toll-free prefix that you use to filter results. Only applies to the US. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchAvailablePhoneNumbersRequest withTollFreePrefix(String tollFreePrefix) { setTollFreePrefix(tollFreePrefix); return this; } /** ** The phone number type used to filter results. Required for non-US numbers. *
* * @param phoneNumberType * The phone number type used to filter results. Required for non-US numbers. * @see PhoneNumberType */ public void setPhoneNumberType(String phoneNumberType) { this.phoneNumberType = phoneNumberType; } /** ** The phone number type used to filter results. Required for non-US numbers. *
* * @return The phone number type used to filter results. Required for non-US numbers. * @see PhoneNumberType */ public String getPhoneNumberType() { return this.phoneNumberType; } /** ** The phone number type used to filter results. Required for non-US numbers. *
* * @param phoneNumberType * The phone number type used to filter results. Required for non-US numbers. * @return Returns a reference to this object so that method calls can be chained together. * @see PhoneNumberType */ public SearchAvailablePhoneNumbersRequest withPhoneNumberType(String phoneNumberType) { setPhoneNumberType(phoneNumberType); return this; } /** ** The phone number type used to filter results. Required for non-US numbers. *
* * @param phoneNumberType * The phone number type used to filter results. Required for non-US numbers. * @return Returns a reference to this object so that method calls can be chained together. * @see PhoneNumberType */ public SearchAvailablePhoneNumbersRequest withPhoneNumberType(PhoneNumberType phoneNumberType) { this.phoneNumberType = phoneNumberType.toString(); return this; } /** ** The maximum number of results to return in a single call. *
* * @param maxResults * The maximum number of results to return in a single call. */ public void setMaxResults(Integer maxResults) { this.maxResults = maxResults; } /** ** The maximum number of results to return in a single call. *
* * @return The maximum number of results to return in a single call. */ public Integer getMaxResults() { return this.maxResults; } /** ** The maximum number of results to return in a single call. *
* * @param maxResults * The maximum number of results to return in a single call. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchAvailablePhoneNumbersRequest withMaxResults(Integer maxResults) { setMaxResults(maxResults); return this; } /** ** The token used to retrieve the next page of results. *
* * @param nextToken * The token used to retrieve the next page of results. */ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** ** The token used to retrieve the next page of results. *
* * @return The token used to retrieve the next page of results. */ public String getNextToken() { return this.nextToken; } /** ** The token used to retrieve the next page of results. *
* * @param nextToken * The token used to retrieve the next page of results. * @return Returns a reference to this object so that method calls can be chained together. */ public SearchAvailablePhoneNumbersRequest withNextToken(String nextToken) { setNextToken(nextToken); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAreaCode() != null) sb.append("AreaCode: ").append(getAreaCode()).append(","); if (getCity() != null) sb.append("City: ").append(getCity()).append(","); if (getCountry() != null) sb.append("Country: ").append(getCountry()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getTollFreePrefix() != null) sb.append("TollFreePrefix: ").append(getTollFreePrefix()).append(","); if (getPhoneNumberType() != null) sb.append("PhoneNumberType: ").append(getPhoneNumberType()).append(","); if (getMaxResults() != null) sb.append("MaxResults: ").append(getMaxResults()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SearchAvailablePhoneNumbersRequest == false) return false; SearchAvailablePhoneNumbersRequest other = (SearchAvailablePhoneNumbersRequest) obj; if (other.getAreaCode() == null ^ this.getAreaCode() == null) return false; if (other.getAreaCode() != null && other.getAreaCode().equals(this.getAreaCode()) == false) return false; if (other.getCity() == null ^ this.getCity() == null) return false; if (other.getCity() != null && other.getCity().equals(this.getCity()) == false) return false; if (other.getCountry() == null ^ this.getCountry() == null) return false; if (other.getCountry() != null && other.getCountry().equals(this.getCountry()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getTollFreePrefix() == null ^ this.getTollFreePrefix() == null) return false; if (other.getTollFreePrefix() != null && other.getTollFreePrefix().equals(this.getTollFreePrefix()) == false) return false; if (other.getPhoneNumberType() == null ^ this.getPhoneNumberType() == null) return false; if (other.getPhoneNumberType() != null && other.getPhoneNumberType().equals(this.getPhoneNumberType()) == false) return false; if (other.getMaxResults() == null ^ this.getMaxResults() == null) return false; if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAreaCode() == null) ? 0 : getAreaCode().hashCode()); hashCode = prime * hashCode + ((getCity() == null) ? 0 : getCity().hashCode()); hashCode = prime * hashCode + ((getCountry() == null) ? 0 : getCountry().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getTollFreePrefix() == null) ? 0 : getTollFreePrefix().hashCode()); hashCode = prime * hashCode + ((getPhoneNumberType() == null) ? 0 : getPhoneNumberType().hashCode()); hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; } @Override public SearchAvailablePhoneNumbersRequest clone() { return (SearchAvailablePhoneNumbersRequest) super.clone(); } }