forge-dashboard-sdk-php

ActionError implements ModelInterface, ArrayAccess, JsonSerializable

ActionError Class Doc Comment

Tags
category

Class

description

The structured result of a refused pull request action (Merge, Close, Update branch, Enable auto-merge, Dependabot and Renovate rebase). `code` and `message` are what a client should act on and show.

author

OpenAPI Generator team

link
https://openapi-generator.tech
implements

Table of Contents

Interfaces

ModelInterface
Interface abstracting model access.
ArrayAccess
JsonSerializable

Constants

CODE_ALREADY_CLOSED  : mixed = 'already_closed'
CODE_ALREADY_MERGED  : mixed = 'already_merged'
CODE_ALREADY_UP_TO_DATE  : mixed = 'already_up_to_date'
CODE_AUTO_MERGE_NOT_ALLOWED  : mixed = 'auto_merge_not_allowed'
CODE_BEHIND  : mixed = 'behind'
CODE_BLOCKED_BY_PROTECTION  : mixed = 'blocked_by_protection'
CODE_CHECKS_FAILING  : mixed = 'checks_failing'
CODE_CHECKS_PENDING  : mixed = 'checks_pending'
CODE_CONFLICT  : mixed = 'conflict'
CODE_NOT_MERGEABLE  : mixed = 'not_mergeable'
CODE_PERMISSION  : mixed = 'permission'
CODE_RATE_LIMITED  : mixed = 'rate_limited'
CODE_READY_TO_MERGE  : mixed = 'ready_to_merge'
CODE_UNKNOWN  : mixed = 'unknown'
DISCRIMINATOR  : mixed = null

Properties

$attributeMap  : array<string|int, string>
Array of attributes where the key is the local name, and the value is the original name
$container  : array<string|int, mixed>
Associative array for storing property values
$getters  : array<string|int, string>
Array of attributes to getter functions (for serialization of requests)
$openAPIFormats  : array<string|int, string>
Array of property to format mappings. Used for (de)serialization
$openAPIModelName  : string
The original name of the model.
$openAPINullables  : array<string|int, bool>
Array of nullable properties. Used for (de)serialization
$openAPINullablesSetToNull  : array<string|int, bool>
If a nullable field gets set to null, insert it here
$openAPITypes  : array<string|int, string>
Array of property to type mappings. Used for (de)serialization
$setters  : array<string|int, string>
Array of attributes to setter functions (for deserialization of responses)

Methods

__construct()  : mixed
Constructor
__toString()  : string
Gets the string presentation of the object
attributeMap()  : array<string|int, mixed>
Array of attributes where the key is the local name, and the value is the original name
getCode()  : string
Gets code
getCodeAllowableValues()  : array<string|int, string>
Gets allowable values of the enum
getError()  : string
Gets error
getMessage()  : string
Gets message
getModelName()  : string
The original name of the model.
getResetsAt()  : DateTime|null
Gets resets_at
getters()  : array<string|int, mixed>
Array of attributes to getter functions (for serialization of requests)
isNullable()  : bool
Checks if a property is nullable
isNullableSetToNull()  : bool
Checks if a nullable property is set to null.
jsonSerialize()  : mixed
Serializes the object to a value that can be serialized natively by json_encode().
listInvalidProperties()  : array<string|int, mixed>
Show all the invalid properties with reasons.
offsetExists()  : bool
Returns true if offset exists. False otherwise.
offsetGet()  : mixed|null
Gets offset.
offsetSet()  : void
Sets value based on offset.
offsetUnset()  : void
Unsets offset.
openAPIFormats()  : array<string|int, mixed>
Array of property to format mappings. Used for (de)serialization
openAPITypes()  : array<string|int, mixed>
Array of property to type mappings. Used for (de)serialization
setCode()  : self
Sets code
setError()  : self
Sets error
setMessage()  : self
Sets message
setResetsAt()  : self
Sets resets_at
setters()  : array<string|int, mixed>
Array of attributes to setter functions (for deserialization of responses)
toHeaderValue()  : string
Gets a header-safe presentation of the object
valid()  : bool
Validate all the properties in the model return true if all passed
openAPINullables()  : array<string|int, mixed>
Array of nullable properties
getOpenAPINullablesSetToNull()  : array<string|int, bool>
Array of nullable field names deliberately set to null
setIfExists()  : void
Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the $this->openAPINullablesSetToNull array
setOpenAPINullablesSetToNull()  : void
Setter - Array of nullable field names deliberately set to null

Constants

CODE_ALREADY_CLOSED

public mixed CODE_ALREADY_CLOSED = 'already_closed'

CODE_ALREADY_MERGED

public mixed CODE_ALREADY_MERGED = 'already_merged'

CODE_ALREADY_UP_TO_DATE

public mixed CODE_ALREADY_UP_TO_DATE = 'already_up_to_date'

CODE_AUTO_MERGE_NOT_ALLOWED

public mixed CODE_AUTO_MERGE_NOT_ALLOWED = 'auto_merge_not_allowed'

CODE_BLOCKED_BY_PROTECTION

public mixed CODE_BLOCKED_BY_PROTECTION = 'blocked_by_protection'

CODE_CHECKS_FAILING

public mixed CODE_CHECKS_FAILING = 'checks_failing'

CODE_CHECKS_PENDING

public mixed CODE_CHECKS_PENDING = 'checks_pending'

CODE_CONFLICT

public mixed CODE_CONFLICT = 'conflict'

CODE_NOT_MERGEABLE

public mixed CODE_NOT_MERGEABLE = 'not_mergeable'

CODE_PERMISSION

public mixed CODE_PERMISSION = 'permission'

CODE_RATE_LIMITED

public mixed CODE_RATE_LIMITED = 'rate_limited'

CODE_READY_TO_MERGE

public mixed CODE_READY_TO_MERGE = 'ready_to_merge'

Properties

$attributeMap

Array of attributes where the key is the local name, and the value is the original name

protected static array<string|int, string> $attributeMap = ['error' => 'error', 'code' => 'code', 'message' => 'message', 'resets_at' => 'resetsAt']

$container

Associative array for storing property values

protected array<string|int, mixed> $container = []

$getters

Array of attributes to getter functions (for serialization of requests)

protected static array<string|int, string> $getters = ['error' => 'getError', 'code' => 'getCode', 'message' => 'getMessage', 'resets_at' => 'getResetsAt']

$openAPIFormats

Array of property to format mappings. Used for (de)serialization

protected static array<string|int, string> $openAPIFormats = ['error' => null, 'code' => null, 'message' => null, 'resets_at' => 'date-time']
Tags
phpstan-var

array<string, string|null>

psalm-var

array<string, string|null>

$openAPIModelName

The original name of the model.

protected static string $openAPIModelName = 'ActionError'

$openAPINullables

Array of nullable properties. Used for (de)serialization

protected static array<string|int, bool> $openAPINullables = ['error' => false, 'code' => false, 'message' => false, 'resets_at' => false]

$openAPINullablesSetToNull

If a nullable field gets set to null, insert it here

protected array<string|int, bool> $openAPINullablesSetToNull = []

$openAPITypes

Array of property to type mappings. Used for (de)serialization

protected static array<string|int, string> $openAPITypes = ['error' => 'string', 'code' => 'string', 'message' => 'string', 'resets_at' => '\DateTime']

$setters

Array of attributes to setter functions (for deserialization of responses)

protected static array<string|int, string> $setters = ['error' => 'setError', 'code' => 'setCode', 'message' => 'setMessage', 'resets_at' => 'setResetsAt']

Methods

__construct()

Constructor

public __construct([array<string|int, mixed>|null $data = null ]) : mixed
Parameters
$data : array<string|int, mixed>|null = null

Associated array of property values initializing the model

__toString()

Gets the string presentation of the object

public __toString() : string
Return values
string

attributeMap()

Array of attributes where the key is the local name, and the value is the original name

public static attributeMap() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCode()

Gets code

public getCode() : string
Return values
string

getCodeAllowableValues()

Gets allowable values of the enum

public getCodeAllowableValues() : array<string|int, string>
Return values
array<string|int, string>

getError()

Gets error

public getError() : string
Return values
string

getMessage()

Gets message

public getMessage() : string
Return values
string

getModelName()

The original name of the model.

public getModelName() : string
Return values
string

getResetsAt()

Gets resets_at

public getResetsAt() : DateTime|null
Return values
DateTime|null

getters()

Array of attributes to getter functions (for serialization of requests)

public static getters() : array<string|int, mixed>
Return values
array<string|int, mixed>

isNullable()

Checks if a property is nullable

public static isNullable(string $property) : bool
Parameters
$property : string
Return values
bool

isNullableSetToNull()

Checks if a nullable property is set to null.

public isNullableSetToNull(string $property) : bool
Parameters
$property : string
Return values
bool

listInvalidProperties()

Show all the invalid properties with reasons.

public listInvalidProperties() : array<string|int, mixed>
Return values
array<string|int, mixed> —

invalid properties with reasons

offsetExists()

Returns true if offset exists. False otherwise.

public offsetExists(int|string $offset) : bool
Parameters
$offset : int|string

Offset

Return values
bool

offsetGet()

Gets offset.

public offsetGet(int|string $offset) : mixed|null
Parameters
$offset : int|string

Offset

Attributes
#[ReturnTypeWillChange]
Return values
mixed|null

offsetSet()

Sets value based on offset.

public offsetSet(int|null $offset, mixed $value) : void
Parameters
$offset : int|null

Offset

$value : mixed

Value to be set

offsetUnset()

Unsets offset.

public offsetUnset(int|string $offset) : void
Parameters
$offset : int|string

Offset

openAPIFormats()

Array of property to format mappings. Used for (de)serialization

public static openAPIFormats() : array<string|int, mixed>
Return values
array<string|int, mixed>

openAPITypes()

Array of property to type mappings. Used for (de)serialization

public static openAPITypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

setCode()

Sets code

public setCode(string $code) : self
Parameters
$code : string

Why the action was refused, from a re-read of the pull request's real state. already_merged and already_closed mean the dashboard's row was stale: the pull request has nothing left to merge. Three codes belong to one action each: already_up_to_date (Update branch: nothing to bring in), auto_merge_not_allowed (Enable auto-merge: the repo or pull request doesn't allow it) and ready_to_merge (Enable auto-merge: already clean, use Merge).

Return values
self

setError()

Sets error

public setError(string $error) : self
Parameters
$error : string

The same string every Error carries. With code: unknown it is the same plain words as message, since the raw text (internal prefixes, API paths, URLs) goes to the server log. With any other code it is the forge's own text, for logs.

Return values
self

setMessage()

Sets message

public setMessage(string $message) : self
Parameters
$message : string

A short reason in plain words, safe to show a person, always. With code: unknown it is the forge's own sentence when that reads as one, "The forge didn't answer. Try again in a moment." when the forge was unreachable (including a 502, 503 or 504), and "The forge refused this action and gave no reason." otherwise. It never holds an internal prefix, an API path, a URL or JSON.

Return values
self

setResetsAt()

Sets resets_at

public setResetsAt(DateTime|null $resets_at) : self
Parameters
$resets_at : DateTime|null

Only with rate_limited, when the forge said so. When the budget comes back.

Return values
self

setters()

Array of attributes to setter functions (for deserialization of responses)

public static setters() : array<string|int, mixed>
Return values
array<string|int, mixed>

toHeaderValue()

Gets a header-safe presentation of the object

public toHeaderValue() : string
Return values
string

valid()

Validate all the properties in the model return true if all passed

public valid() : bool
Return values
bool —

True if all properties are valid

openAPINullables()

Array of nullable properties

protected static openAPINullables() : array<string|int, mixed>
Return values
array<string|int, mixed>

getOpenAPINullablesSetToNull()

Array of nullable field names deliberately set to null

private getOpenAPINullablesSetToNull() : array<string|int, bool>
Return values
array<string|int, bool>

setIfExists()

Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the $this->openAPINullablesSetToNull array

private setIfExists(string $variableName, array<string|int, mixed> $fields, mixed $defaultValue) : void
Parameters
$variableName : string
$fields : array<string|int, mixed>
$defaultValue : mixed

setOpenAPINullablesSetToNull()

Setter - Array of nullable field names deliberately set to null

private setOpenAPINullablesSetToNull(array<string|int, bool> $openAPINullablesSetToNull) : void
Parameters
$openAPINullablesSetToNull : array<string|int, bool>
On this page

Search results