GoldenGateBindings / com.fitbit.goldengate.bindings.coap.data / ResponseCode

ResponseCode

data class ResponseCode

This represents a CoAP response code (analogous to an HTTP response code (e.g. 201, 404, 500)

Types

Class

object Class

Constructors

<init>

ResponseCode(responseClass: Byte, detail: Byte)

This represents a CoAP response code (analogous to an HTTP response code (e.g. 201, 404, 500)

Properties

detail

val detail: Byte

is the class-specific detail code. (e.g. ResponseCode(2, 5) represents CONTENT and ResponseCode (4, 4) represents NOT_FOUND

responseClass

val responseClass: Byte

Response Class is the major class of the code. 2 = Success, 3 = Redirection, 4 = Client Error, 5 = Server Error

Companion Object Properties

badGateway

val badGateway: ResponseCode

CoAP Response Code 502

badOption

val badOption: ResponseCode

CoAP Response Code 402

badRequest

val badRequest: ResponseCode

CoAP Response Code 400

changed

val changed: ResponseCode

CoAP Response Code 204

content

val content: ResponseCode

CoAP Response Code 205

continue

val continue: ResponseCode

CoAP Response Code 231

created

val created: ResponseCode

CoAP Response Code 201

deleted

val deleted: ResponseCode

CoAP Response Code 202

forbidden

val forbidden: ResponseCode

CoAP Response Code 403

gatewayTimeout

val gatewayTimeout: ResponseCode

CoAP Response Code 504

internalServerError

val internalServerError: ResponseCode

CoAP Response Code 500

methodNotAllowed

val methodNotAllowed: ResponseCode

CoAP Response Code 405

notAcceptable

val notAcceptable: ResponseCode

CoAP Response Code 406

notFound

val notFound: ResponseCode

CoAP Response Code 404

notImplemented

val notImplemented: ResponseCode

CoAP Response Code 501

preconditionFailed

val preconditionFailed: ResponseCode

CoAP Response Code 412

proxyingNotSupported

val proxyingNotSupported: ResponseCode

CoAP Response Code 505

requestEntityIncomplete

val requestEntityIncomplete: ResponseCode

CoAP Response Code 408

requestEntityTooLarge

val requestEntityTooLarge: ResponseCode

CoAP Response Code 413

serviceUnavailable

val serviceUnavailable: ResponseCode

CoAP Response Code 503

unauthorized

val unauthorized: ResponseCode

CoAP Response Code 401

unsupportedContentFormat

val unsupportedContentFormat: ResponseCode

CoAP Response Code 415

valid

val valid: ResponseCode

CoAP Response Code 203

Extension Functions

clientError

fun ResponseCode.clientError(): Boolean

Extension function that return true if response is client error, false otherwise

error

fun ResponseCode.error(): Boolean

Extension function that return true if response is client or server error, false otherwise

ok

fun ResponseCode.ok(): Boolean

Extension function that return true if response is ok, false otherwise

serverError

fun ResponseCode.serverError(): Boolean

Extension function that return true if response is server error, false otherwise