Properties

$name

$name : 

Type

$description

$description : 

Type

$serviceDescription

$serviceDescription : 

Type

$type

$type : 

Type

$required

$required : 

Type

$enum

$enum : 

Type

$pattern

$pattern : 

Type

$minimum

$minimum : 

Type

$maximum

$maximum : 

Type

$minLength

$minLength : 

Type

$maxLength

$maxLength : 

Type

$minItems

$minItems : 

Type

$maxItems

$maxItems : 

Type

$default

$default : 

Type

$static

$static : 

Type

$instanceOf

$instanceOf : 

Type

$filters

$filters : 

Type

$location

$location : 

Type

$sentAs

$sentAs : 

Type

$data

$data : 

Type

$properties

$properties : 

Type

$additionalProperties

$additionalProperties : 

Type

$items

$items : 

Type

$parent

$parent : 

Type

$ref

$ref : 

Type

$format

$format : 

Type

$propertiesCache

$propertiesCache : 

Type

Methods

__construct()

__construct(array  $data = array(), \Guzzle\Service\Description\ServiceDescriptionInterface  $description = null) 

Create a new Parameter using an associative array of data. The array can contain the following information: - name: (string) Unique name of the parameter - type: (string|array) Type of variable (string, number, integer, boolean, object, array, numeric, null, any). Types are using for validation and determining the structure of a parameter. You can use a union type by providing an array of simple types. If one of the union types matches the provided value, then the value is valid.

  • instanceOf: (string) When the type is an object, you can specify the class that the object must implement
  • required: (bool) Whether or not the parameter is required
  • default: (mixed) Default value to use if no value is supplied
  • static: (bool) Set to true to specify that the parameter value cannot be changed from the default
  • description: (string) Documentation of the parameter
  • location: (string) The location of a request used to apply a parameter. Custom locations can be registered with a command, but the defaults are uri, query, header, body, json, xml, postField, postFile.
  • sentAs: (string) Specifies how the data being modeled is sent over the wire. For example, you may wish to include certain headers in a response model that have a normalized casing of FooBar, but the actual header is x-foo-bar. In this case, sentAs would be set to x-foo-bar.
  • filters: (array) Array of static method names to to run a parameter value through. Each value in the array must be a string containing the full class path to a static method or an array of complex filter information. You can specify static methods of classes using the full namespace class name followed by '::' (e.g. Foo\Bar::baz()). Some filters require arguments in order to properly filter a value. For complex filters, use a hash containing a 'method' key pointing to a static method, and an 'args' key containing an array of positional arguments to pass to the method. Arguments can contain keywords that are replaced when filtering a value: '@value' is replaced with the value being validated, '@api' is replaced with the Parameter object.
  • properties: When the type is an object, you can specify nested parameters
  • additionalProperties: (array) This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties.
  • items: This attribute defines the allowed items in an instance array, and MUST be a schema or an array of schemas. The default value is an empty schema which allows any value for items in the instance array. When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema.
  • pattern: When the type is a string, you can specify the regex pattern that a value must match
  • enum: When the type is a string, you can specify a list of acceptable values
  • minItems: (int) Minimum number of items allowed in an array
  • maxItems: (int) Maximum number of items allowed in an array
  • minLength: (int) Minimum length of a string
  • maxLength: (int) Maximum length of a string
  • minimum: (int) Minimum value of an integer
  • maximum: (int) Maximum value of an integer
  • data: (array) Any additional custom data to use when serializing, validating, etc
  • format: (string) Format used to coax a value into the correct format when serializing or unserializing. You may specify either an array of filters OR a format, but not both. Supported values: date-time, date, time, timestamp, date-time-http
  • $ref: (string) String referencing a service description model. The parameter is replaced by the schema contained in the model.

Parameters

array $data

Array of data as seen in service descriptions

\Guzzle\Service\Description\ServiceDescriptionInterface $description

Service description used to resolve models if $ref tags are found

Throws

\Guzzle\Common\Exception\InvalidArgumentException

toArray()

toArray() : array

Convert the object to an array

Returns

array

getValue()

getValue(string  $value) : mixed

Get the default or static value of the command based on a value

Parameters

string $value

Value that is currently set

Returns

mixed —

Returns the value, a static value if one is present, or a default value

filter()

filter(mixed  $value) : mixed

Run a value through the filters OR format attribute associated with the parameter

Parameters

mixed $value

Value to filter

Returns

mixed —

Returns the filtered value

getName()

getName() : string

Get the name of the parameter

Returns

string

getWireName()

getWireName() : string

Get the key of the parameter, where sentAs will supersede name if it is set

Returns

string

setName()

setName(string  $name) : self

Set the name of the parameter

Parameters

string $name

Name to set

Returns

self

getType()

getType() : string|array

Get the type(s) of the parameter

Returns

string|array

setType()

setType(string|array  $type) : self

Set the type(s) of the parameter

Parameters

string|array $type

Type of parameter or array of simple types used in a union

Returns

self

getRequired()

getRequired() : boolean

Get if the parameter is required

Returns

boolean

setRequired()

setRequired(boolean  $isRequired) : self

Set if the parameter is required

Parameters

boolean $isRequired

Whether or not the parameter is required

Returns

self

getDefault()

getDefault() : string|null

Get the default value of the parameter

Returns

string|null

setDefault()

setDefault(string|null  $default) : self

Set the default value of the parameter

Parameters

string|null $default

Default value to set

Returns

self

getDescription()

getDescription() : string|null

Get the description of the parameter

Returns

string|null

setDescription()

setDescription(string  $description) : self

Set the description of the parameter

Parameters

string $description

Description

Returns

self

getMinimum()

getMinimum() : integer|null

Get the minimum acceptable value for an integer

Returns

integer|null

setMinimum()

setMinimum(integer|null  $min) : self

Set the minimum acceptable value for an integer

Parameters

integer|null $min

Minimum

Returns

self

getMaximum()

getMaximum() : integer|null

Get the maximum acceptable value for an integer

Returns

integer|null

setMaximum()

setMaximum(integer  $max) : self

Set the maximum acceptable value for an integer

Parameters

integer $max

Maximum

Returns

self

getMinLength()

getMinLength() : integer

Get the minimum allowed length of a string value

Returns

integer

setMinLength()

setMinLength(integer|null  $min) : self

Set the minimum allowed length of a string value

Parameters

integer|null $min

Minimum

Returns

self

getMaxLength()

getMaxLength() : integer|null

Get the maximum allowed length of a string value

Returns

integer|null

setMaxLength()

setMaxLength(integer  $max) : self

Set the maximum allowed length of a string value

Parameters

integer $max

Maximum length

Returns

self

getMaxItems()

getMaxItems() : integer|null

Get the maximum allowed number of items in an array value

Returns

integer|null

setMaxItems()

setMaxItems(integer  $max) : self

Set the maximum allowed number of items in an array value

Parameters

integer $max

Maximum

Returns

self

getMinItems()

getMinItems() : integer

Get the minimum allowed number of items in an array value

Returns

integer

setMinItems()

setMinItems(integer|null  $min) : self

Set the minimum allowed number of items in an array value

Parameters

integer|null $min

Minimum

Returns

self

getLocation()

getLocation() : string|null

Get the location of the parameter

Returns

string|null

setLocation()

setLocation(string|null  $location) : self

Set the location of the parameter

Parameters

string|null $location

Location of the parameter

Returns

self

getSentAs()

getSentAs() : string|null

Get the sentAs attribute of the parameter that used with locations to sentAs an attribute when it is being applied to a location.

Returns

string|null

setSentAs()

setSentAs(string|null  $name) : self

Set the sentAs attribute

Parameters

string|null $name

Name of the value as it is sent over the wire

Returns

self

getData()

getData(string|null  $name = null) : array|mixed|null

Retrieve a known property from the parameter by name or a data property by name. When not specific name value is specified, all data properties will be returned.

Parameters

string|null $name

Specify a particular property name to retrieve

Returns

array|mixed|null

setData()

setData(string|array|null  $nameOrData, mixed|null  $data = null) : self

Set the extra data properties of the parameter or set a specific extra property

Parameters

string|array|null $nameOrData

The name of a specific extra to set or an array of extras to set

mixed|null $data

When setting a specific extra property, specify the data to set for it

Returns

self

getStatic()

getStatic() : mixed|null

Get whether or not the default value can be changed

Returns

mixed|null

setStatic()

setStatic(boolean  $static) : self

Set to true if the default value cannot be changed

Parameters

boolean $static

True or false

Returns

self

getFilters()

getFilters() : array

Get an array of filters used by the parameter

Returns

array

setFilters()

setFilters(array  $filters) : self

Set the array of filters used by the parameter

Parameters

array $filters

Array of functions to use as filters

Returns

self

addFilter()

addFilter(string|array  $filter) : self

Add a filter to the parameter

Parameters

string|array $filter

Method to filter the value through

Throws

\Guzzle\Common\Exception\InvalidArgumentException

Returns

self

getProperties()

getProperties() : array

Get the properties of the parameter

Returns

array

getProperty()

getProperty(string  $name) : null|\Guzzle\Service\Description\Parameter

Get a specific property from the parameter

Parameters

string $name

Name of the property to retrieve

Returns

null|\Guzzle\Service\Description\Parameter

removeProperty()

removeProperty(string  $name) : self

Remove a property from the parameter

Parameters

string $name

Name of the property to remove

Returns

self

addProperty()

addProperty(\Guzzle\Service\Description\Parameter  $property) : self

Add a property to the parameter

Parameters

\Guzzle\Service\Description\Parameter $property

Properties to set

Returns

self

getAdditionalProperties()

getAdditionalProperties() : boolean|\Guzzle\Service\Description\Parameter|null

Get the additionalProperties value of the parameter

Returns

boolean|\Guzzle\Service\Description\Parameter|null

setAdditionalProperties()

setAdditionalProperties(boolean|\Guzzle\Service\Description\Parameter|null  $additional) : self

Set the additionalProperties value of the parameter

Parameters

boolean|\Guzzle\Service\Description\Parameter|null $additional

Boolean to allow any, an Parameter to specify a schema, or false to disallow

Returns

self

setItems()

setItems(\Guzzle\Service\Description\Parameter|null  $items = null) : self

Set the items data of the parameter

Parameters

\Guzzle\Service\Description\Parameter|null $items

Items to set

Returns

self

getInstanceOf()

getInstanceOf() : null|string

Get the class that the parameter must implement

Returns

null|string

setInstanceOf()

setInstanceOf(string|null  $instanceOf) : self

Set the class that the parameter must be an instance of

Parameters

string|null $instanceOf

Class or interface name

Returns

self

getEnum()

getEnum() : array|null

Get the enum of strings that are valid for the parameter

Returns

array|null

setEnum()

setEnum(array|null  $enum = null) : self

Set the enum of strings that are valid for the parameter

Parameters

array|null $enum

Array of strings or null

Returns

self

getPattern()

getPattern() : string

Get the regex pattern that must match a value when the value is a string

Returns

string

setPattern()

setPattern(string  $pattern) : self

Set the regex pattern that must match a value when the value is a string

Parameters

string $pattern

Regex pattern

Returns

self

getFormat()

getFormat() : string

Get the format attribute of the schema

Returns

string

setFormat()

setFormat(string  $format) : self

Set the format attribute of the schema

Parameters

string $format

Format to set (e.g. date, date-time, timestamp, time, date-time-http)

Returns

self