Parameter
class Parameter
Represents an individual request parameter in a RESTful operation. A parameter can take on many forms: in a URL path, in a URL query, in a JSON body, and in a HTTP header. It is worth documenting brifly each variety of parameter:
Header parameters are those which populate a HTTP header in a request. Header parameters can have aliases; for example, a user-facing name of "Foo" can be sent over the wire as "X-Foo_Bar", as defined by
sentAs
. Prefixes can also be used.Query parameters are those which populate a URL query parameter. The value is therefore usually confined to a string.
JSON parameters are those which populate a JSON request body. These are the most complex variety of Parameter, since there are so many different ways a JSON document can be constructed. The SDK supports deep-nesting according to a XPath syntax; for more information, see {see \OpenStack\Common\JsonPath}. Nested object and array properties are also supported since JSON is a recursive data type. What this means is that a Parameter can have an assortment of child Parameters, one for each object property or array element.
Raw parameters are those which populate a non-JSON request body. This is typically used for uploading payloads (such as Swift object data) to a remote API.
Path parameters are those which populate a URL path. They are serialized according to URL placeholders.
Traits
Constants
DEFAULT_LOCATION |
|
Methods
No description
Retrieve the name that will be used over the wire.
Indicates whether the user must provide a value for this parameter.
Validates a given user value and checks whether it passes basic sanity checking, such as types.
Indicates whether this parameter represents an array type
Indicates whether this parameter represents an object type
No description
Verifies whether the given location matches the parameter's location.
Retrieves the parameter's path.
Retrieves the common schema that an array parameter applies to all its child elements.
Sets the name of the parameter to a new value
Retrieves the child parameter for an object parameter.
Retrieves the prefix for a parameter, if any.
No description
Details
validate($userValues)
Validates a given user value and checks whether it passes basic sanity checking, such as types.
getItemSchema()
Retrieves the common schema that an array parameter applies to all its child elements.