Returns the {@link DnsResponseCode} that corresponds with the given {@code responseCode}.

@param responseCode the DNS RCODE

@return the corresponding {@link DnsResponseCode}
512696
public static DnsResponseCode valueOf(int responseCode) {
        switch (responseCode) {
        case 0:
            return NOERROR;
        case 1:
            return FORMERR;
        case 2:
            return SERVFAIL;
        case 3:
            return NXDOMAIN;
        case 4:
            return NOTIMP;
        case 5:
            return REFUSED;
        case 6:
            return YXDOMAIN;
        case 7:
            return YXRRSET;
        case 8:
            return NXRRSET;
        case 9:
            return NOTAUTH;
        case 10:
            return NOTZONE;
        case 16:
            return BADVERS_OR_BADSIG;
        case 17:
            return BADKEY;
        case 18:
            return BADTIME;
        case 19:
            return BADMODE;
        case 20:
            return BADNAME;
        case 21:
            return BADALG;
        default:
            return new DnsResponseCode(responseCode);
        }
    }
594933
public function getResponse($responseCode)
    {
        return isset($this->responses[$responseCode]) ? $this->responses[$responseCode] : null;
    }
957667
public Observable<List<Domain>> getDomainsAsync() {
        return getDomainsWithServiceResponseAsync().map(new Func1<ServiceResponse<List<Domain>>, List<Domain>>() {
            @Override
            public List<Domain> call(ServiceResponse<List<Domain>> response) {
                return response.body();
            }
        });
    }
104669
public static HttpResponseStatus valueOf(int code) {
    switch (code) {
      case 100:
        return CONTINUE;
      case 101:
        return SWITCHING_PROTOCOLS;
      case 102:
        return PROCESSING;
      case 200:
        return OK;
      case 201:
        return CREATED;
      case 202:
        return ACCEPTED;
      case 203:
        return NON_AUTHORITATIVE_INFORMATION;
      case 204:
        return NO_CONTENT;
      case 205:
        return RESET_CONTENT;
      case 206:
        return PARTIAL_CONTENT;
      case 207:
        return MULTI_STATUS;
      case 300:
        return MULTIPLE_CHOICES;
      case 301:
        return MOVED_PERMANENTLY;
      case 302:
        return FOUND;
      case 303:
        return SEE_OTHER;
      case 304:
        return NOT_MODIFIED;
      case 305:
        return USE_PROXY;
      case 307:
        return TEMPORARY_REDIRECT;
      case 400:
        return BAD_REQUEST;
      case 401:
        return UNAUTHORIZED;
      case 402:
        return PAYMENT_REQUIRED;
      case 403:
        return FORBIDDEN;
      case 404:
        return NOT_FOUND;
      case 405:
        return METHOD_NOT_ALLOWED;
      case 406:
        return NOT_ACCEPTABLE;
      case 407:
        return PROXY_AUTHENTICATION_REQUIRED;
      case 408:
        return REQUEST_TIMEOUT;
      case 409:
        return CONFLICT;
      case 410:
        return GONE;
      case 411:
        return LENGTH_REQUIRED;
      case 412:
        return PRECONDITION_FAILED;
      case 413:
        return REQUEST_ENTITY_TOO_LARGE;
      case 414:
        return REQUEST_URI_TOO_LONG;
      case 415:
        return UNSUPPORTED_MEDIA_TYPE;
      case 416:
        return REQUESTED_RANGE_NOT_SATISFIABLE;
      case 417:
        return EXPECTATION_FAILED;
      case 422:
        return UNPROCESSABLE_ENTITY;
      case 423:
        return LOCKED;
      case 424:
        return FAILED_DEPENDENCY;
      case 425:
        return UNORDERED_COLLECTION;
      case 426:
        return UPGRADE_REQUIRED;
      case 500:
        return INTERNAL_SERVER_ERROR;
      case 501:
        return NOT_IMPLEMENTED;
      case 502:
        return BAD_GATEWAY;
      case 503:
        return SERVICE_UNAVAILABLE;
      case 504:
        return GATEWAY_TIMEOUT;
      case 505:
        return HTTP_VERSION_NOT_SUPPORTED;
      case 506:
        return VARIANT_ALSO_NEGOTIATES;
      case 507:
        return INSUFFICIENT_STORAGE;
      case 510:
        return NOT_EXTENDED;
    }

    final String reasonPhrase;

    if (code < 100) {
      reasonPhrase = "Unknown Status";
    } else if (code < 200) {
      reasonPhrase = "Informational";
    } else if (code < 300) {
      reasonPhrase = "Successful";
    } else if (code < 400) {
      reasonPhrase = "Redirection";
    } else if (code < 500) {
      reasonPhrase = "Client Error";
    } else if (code < 600) {
      reasonPhrase = "Server Error";
    } else {
      reasonPhrase = "Unknown Status";
    }

    return new HttpResponseStatus(code, reasonPhrase + " (" + code + ')');
  }
376097
public GetOauthUserInfoResponse getOauthUserInfo(String code){
        if(StrUtil.isBlank(code)){
            throw new NullPointerException("code is null");
        }
        GetOauthUserInfoResponse response;
        String url = BASE_API_URL + "cgi-bin/user/getuserinfo?access_token=#&code=" + code;
        BaseResponse r = executeGet(url);
        String jsonResult = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(jsonResult, GetOauthUserInfoResponse.class);
        return response;
    }
77296
public static dnsnsrec get(nitro_service service, String domain) throws Exception{
		dnsnsrec obj = new dnsnsrec();
		obj.set_domain(domain);
		dnsnsrec response = (dnsnsrec) obj.get_resource(service);
		return response;
	}
573334
public static boolean hasResponseBody(String requestMethod, int responseCode) {
        return requestMethod != Request.Method.HEAD
                && !(100 <= responseCode && responseCode < HttpURLConnection.HTTP_OK)
                && responseCode != HttpURLConnection.HTTP_NO_CONTENT
                && responseCode != HttpURLConnection.HTTP_RESET
                && responseCode != HttpURLConnection.HTTP_NOT_MODIFIED;
    }
244798
private int getStatusCode(final byte[] response, final int request) throws UnknownResponseException {
		if (response == null || response.length < 3 || response[0] != OP_CODE_RESPONSE_CODE_KEY || response[1] != request ||
				(response[2] != DFU_STATUS_SUCCESS &&
						response[2] != SecureDfuError.OP_CODE_NOT_SUPPORTED &&
						response[2] != SecureDfuError.INVALID_PARAM &&
						response[2] != SecureDfuError.INSUFFICIENT_RESOURCES &&
						response[2] != SecureDfuError.INVALID_OBJECT &&
						response[2] != SecureDfuError.UNSUPPORTED_TYPE &&
						response[2] != SecureDfuError.OPERATION_NOT_PERMITTED &&
						response[2] != SecureDfuError.OPERATION_FAILED &&
						response[2] != SecureDfuError.EXTENDED_ERROR))
			throw new UnknownResponseException("Invalid response received", response, OP_CODE_RESPONSE_CODE_KEY, request);
		return response[2];
	}
203008
public static dnsnameserver[] get(nitro_service service) throws Exception{
		dnsnameserver obj = new dnsnameserver();
		dnsnameserver[] response = (dnsnameserver[])obj.get_resources(service);
		return response;
	}
293246
public GetStatHttpCodeResponse getStatHttpCode(GetStatHttpCodeRequest request) {
        InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, STAT, "httpcode");
        
        if (request.getStartTime() != null) {
            internalRequest.addParameter("startTime", DateUtils.formatAlternateIso8601Date(request.getStartTime()));
        }
        
        if (request.getEndTime() != null) {
            internalRequest.addParameter("endTime", DateUtils.formatAlternateIso8601Date(request.getEndTime()));
        }
        
        if (request.getDomain() != null) {
            internalRequest.addParameter("domain", request.getDomain());
        }
        
        if (request.getPeriod() != null) {
            internalRequest.addParameter("period", String.valueOf(request.getPeriod()));
        }
        
        if (request.isWithRegion()) {
            internalRequest.addParameter("withRegion", "");
        }
        
        return this.invokeHttpClient(internalRequest, GetStatHttpCodeResponse.class);
    }
117308
public static dnscnamerec[] get(nitro_service service, String aliasname[]) throws Exception{
		if (aliasname !=null && aliasname.length>0) {
			dnscnamerec response[] = new dnscnamerec[aliasname.length];
			dnscnamerec obj[] = new dnscnamerec[aliasname.length];
			for (int i=0;i<aliasname.length;i++) {
				obj[i] = new dnscnamerec();
				obj[i].set_aliasname(aliasname[i]);
				response[i] = (dnscnamerec) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
139265
private static void encodeHeader(DnsResponse response, ByteBuf buf) {
        buf.writeShort(response.id());
        int flags = 32768;
        flags |= (response.opCode().byteValue() & 0xFF) << 11;
        if (response.isAuthoritativeAnswer()) {
            flags |= 1 << 10;
        }
        if (response.isTruncated()) {
            flags |= 1 << 9;
        }
        if (response.isRecursionDesired()) {
            flags |= 1 << 8;
        }
        if (response.isRecursionAvailable()) {
            flags |= 1 << 7;
        }
        flags |= response.z() << 4;
        flags |= response.code().intValue();
        buf.writeShort(flags);
        buf.writeShort(response.count(DnsSection.QUESTION));
        buf.writeShort(response.count(DnsSection.ANSWER));
        buf.writeShort(response.count(DnsSection.AUTHORITY));
        buf.writeShort(response.count(DnsSection.ADDITIONAL));
    }
545998
public static dnsnsecrec[] get(nitro_service service, String hostname[]) throws Exception{
		if (hostname !=null && hostname.length>0) {
			dnsnsecrec response[] = new dnsnsecrec[hostname.length];
			dnsnsecrec obj[] = new dnsnsecrec[hostname.length];
			for (int i=0;i<hostname.length;i++) {
				obj[i] = new dnsnsecrec();
				obj[i].set_hostname(hostname[i]);
				response[i] = (dnsnsecrec) obj[i].get_resource(service);
			}
			return response;
		}
		return null;
	}
84017
public static dnspolicylabel[] get(nitro_service service) throws Exception{
		dnspolicylabel obj = new dnspolicylabel();
		dnspolicylabel[] response = (dnspolicylabel[])obj.get_resources(service);
		return response;
	}
99548
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
		dns_stats[] resources = new dns_stats[1];
		dns_response result = (dns_response) service.get_payload_formatter().string_to_resource(dns_response.class, response);
		if(result.errorcode != 0) {
			if (result.errorcode == 444) {
				service.clear_session();
			}
			if(result.severity != null)
			{
				if (result.severity.equals("ERROR"))
					throw new nitro_exception(result.message,result.errorcode);
			}
			else
			{
				throw new nitro_exception(result.message,result.errorcode);
			}
		}
		resources[0] = result.dns;
		return resources;
	}
1105358
public static dnsaddrec[] get(nitro_service service, dnsaddrec_args args) throws Exception{
		dnsaddrec obj = new dnsaddrec();
		options option = new options();
		option.set_args(nitro_util.object_to_string_withoutquotes(args));
		dnsaddrec[] response = (dnsaddrec[])obj.get_resources(service, option);
		return response;
	}
925772
int getResponseCodeFromBundle(Bundle b) {
        Object o = b.get(RESPONSE_CODE);
        if (o == null) {
            logDebug("Bundle with null response code, assuming OK (known issue)");
            return BILLING_RESPONSE_RESULT_OK;
        }
        else if (o instanceof Integer) return ((Integer)o).intValue();
        else if (o instanceof Long) return (int)((Long)o).longValue();
        else {
            logError("Unexpected type for bundle response code.");
            logError(o.getClass().getName());
            throw new RuntimeException("Unexpected type for bundle response code: " + o.getClass().getName());
        }
    }