Cowbird: Middleware operation service
- Cowbird (the brood parasite)
- The brood parasite manipulates a host, either of the same or of another species, *to raise its young as if it were its ownThe shiny cowbird is an obligate brood parasite, meaning that adults will lay their eggs in the nests of other species and their offspring rely entirely on their hosts for parental care.
Cowbird is a middleware that manages interactions between various birds of the bird-house stack.
It therefore relies on the existence of other services under a common architecture, but applies changes to the resources under those services such that the complete ecosystem can seamlessly operate together (see Components Diagram).
dependencies |
|
---|---|
build status |
|
tests status |
|
docker status |
|
releases |
Documentation
The REST API documentation is auto-generated and served under {COWBIRD_URL}/api/
using
Swagger-UI with tag latest
.
Configuration and Usage
Cowbird
application.Docker Images
Following most recent variants are available:
Version |
Cowbird Base |
Cowbird Worker |
Cowbird Web Service |
---|---|---|---|
Most Recent Release |
|||
Latest Commit |
Notes:
Older tags the are also available: Docker Images
Table of Contents
Usage
In most situation, you will want to run Cowbird as a Web Application in combination with a larger set of bird-house components forming a server instance. A minimal docker-compose.yml example is provided, but Cowbird’s actual configuration will greatly depend on your actual service requirements.
Setup and Validation
To use Cowbird in a project, first you need to install it. To do so, please follow steps in Installation and Configuration procedures.
After this, you should be able to call the CLI CLI Utilities to validate it is installed properly using:
cowbird --help
Web Application
To start the Web Application, you can simply run the following command:
make start
This will first install any missing dependencies in the current environment (see Installation), and will
after start a basic Web Application on localhost:7000
with default configurations.
Please refer to Configuration if any of the parameters needs adjustment for custom environments.
For running the application, multiple WSGI HTTP Servers can be employed (e.g.: Gunicorn, Waitress, etc.). They usually all support as input an INI configuration file for specific settings. Cowbird also employs such INI file (cowbird.ini) to customize its behaviour. See Configuration for further details, and please refer to the employed WSGI application documentation of your liking for their respective setup requirements.
API
When the application is started, the Swagger API should be available under /api
path. This will render the current
version API and applicable requests. Please refer to this documentation to discover all provided API paths and
events supported by Cowbird on a running instance (that could be older than latest code base). Alternatively,
documentation of all versions is available on ReadTheDocs.
CLI
After successful Installation of Cowbird package, multiple helper CLI Utilities become available as CLI applications callable from the shell. These can be quite useful to run typical Cowbird events calls from the terminal without having to form corresponding HTTP requests. Please refer to the relevant page for further details.
Documentation
The documentation is automatically built by ReadTheDocs. It is generated from the documentation source,
the parsing of Python docstrings
within the code, the code itself, and the Cowbird REST API.
You can also preview the result by building the documentation locally using:
make docs
The resulting location will be printed on the terminal and can be opened in a web browser.
Testing
Tests are executed using a Web Application that gets spawned by a set of default configurations to run HTTP requests against.
Note
To customize execution parameters, you can export variables such as COWBIRD_INI_FILE_PATH
for example,
and they will be picked up to validate specific results against defined Configuration.
When adding new features or fixing bugs, it is recommended to execute linting checks and tests locally prior to opening a PR, as each PR gets tested and you will waste more time waiting for results to complete then if ran locally.
To validate linting of the code, simply call:
make check
To run all tests locally, simply execute the following command:
make test
Coverage analysis with the same set of tests is also available using:
make coverage
You can also run subsets of tests according to markers and/or specific test function pytest
specification using:
make SPEC="<CUSTOM TEST SPECIFICATIONS>" test-custom
Or some of the predefined filters:
make test-api
make test-cli
Finally, the following command can be executed to built and run a smoke test of the resulting Docker image:
make test-docker
Installation
Basic Setup
At the command line:
make install
This will create a conda
environment named cowbird
, and install all required dependencies of the package in it.
You should be ready to employ Cowbird with example Configuration files at this point.
Advanced
To install in another environment, CONDA_ENV_NAME
can be provided to make
.
Otherwise, following can be used to install with whichever python
is detected (up to user to manage references):
make install-pkg
If you want the full setup for development (including dependencies for test execution), use:
make install-dev
Configuration
At startup, Cowbird application will load multiple configuration files to define various behaviours or setup operations. These are defined though the configuration settings presented in below sections.
All generic Cowbird configuration settings can be defined through either the cowbird.ini file or environment
variables. Values defined in cowbird.ini are expected to follow the cowbird.[variable_name]
format, and
corresponding COWBIRD_[VARIABLE_NAME]
format is used for environment variables. Both of these alternatives match
the constants defined in cowbird/constants.py and can be used interchangeably.
Configuration Files
File: cowbird.ini
This is the base configuration file that defines most of Cowbird’s lower level application configuration (API, CLI). A basic cowbird.example.ini configuration is provided, which should allow any user to run the application locally. It is recommended to create a copy of this file as cowbird.ini to customize settings to your linking (this file is ignored for repository commits).
Furthermore, this file is used by default in each tagged Docker image, and mounted at
${COWBIRD_CONFIG_DIR}/cowbird.ini
location. If you want to provide different configuration, the file should be
overridden in the Docker image using a volume mount parameter, or by specifying an alternative path through the
environment variable COWBIRD_INI_FILE_PATH
.
File: config.yml
This is the core configuration file that defines most of Cowbird’s data configuration which it must work with to manage Services components. A basic config.example.yml file is provided, for sample definition of expected schemas per service. Please refer to its comment header for specific format and parameter details.
Settings and Constants
Environment variables can be used to define all following configurations (unless mentioned otherwise with
[constant]
keyword next to the parameter name). Most values are parsed as plain strings, unless they refer to an
activatable setting (e.g.: True
or False
), or when specified with more specific [<type>]
notation.
Configuration variables will be used by Cowbird on startup unless prior definition is found within cowbird.ini.
All variables (i.e.: non-[constant]
parameters) can also be specified by their cowbird.[variable_name]
setting
counterpart as described at the start of the Configuration section.
Loading Settings
These settings can be used to specify where to find other settings through custom configuration files.
COWBIRD_MODULE_DIR
[constant]Path to the top level
cowbird
module (ie: source code).COWBIRD_ROOT
[constant]Path to the containing directory of Cowbird. This corresponds to the directory where the repository was cloned or where the package was installed.
COWBIRD_CONFIG_DIR
(Default:${COWBIRD_ROOT}/config
)Configuration directory where to look for cowbird.ini file.
COWBIRD_CONFIG_PATH
Explicit path where to find a config.yml configuration file to load at Cowbird startup.
See also
COWBIRD_INI_FILE_PATH
Specifies where to find the initialization file to run Cowbird application.
Warning
This variable ignores the setting/env-var resolution order since settings cannot be defined without firstly loading the file referenced by its value.
See also
Application Settings
Following configuration parameters are used to define values that are employed by Cowbird after loading
the Loading Settings. All cowbird.[variable_name]
counterpart definitions are also available as described
at the start of the Configuration section.
COWBIRD_URL
(Default:"http://localhost:2001"
)Full hostname URL to use so that Cowbird can resolve his own running instance location.
Note
This value is notably useful to indicate the exposed proxy location where Cowbird should be invoked from within a server stack that integrates it.
COWBIRD_LOG_LEVEL
(Default:INFO
)Logging level of operations. Cowbird will first use the complete logging configuration found in cowbird.ini in order to define logging formatters and handler referencing to the
logger_cowbird
section. If this configuration fail to retrieve an explicit logging level, this configuration variable is used instead to prepare a basic logger, after checking if a correspondingcowbird.log_level
setting was instead specified.Warning
When setting
DEBUG
level or lower, Cowbird could potentially dump some sensitive information in logs. It is important to avoid this setting for production systems.COWBIRD_LOG_PRINT
(Default:False
)Specifies whether Cowbird logging should also enforce printing the details to the console when using CLI Utilities. Otherwise, the configured logging methodology in cowbird.ini is used (which can also define a console handler).
COWBIRD_LOG_REQUEST
(Default:True
)Specifies whether Cowbird should log incoming request details.
Note
This can make Cowbird quite verbose if large quantity of requests are accomplished.
COWBIRD_LOG_EXCEPTION
(Default:True
)Specifies whether Cowbird should log a raised exception during a process execution.
Components Diagram

CLI Utilities
CLI Helpers and Commands
Multiple CLI helpers are provided.
The common functions provided allow invocation and result retrieval similar to the Web API, but from a terminal. The Configuration files must be available in default location, or provided as input to resolve operations.
Please refer to the corresponding usage detail of each helper by calling them with --help
argument for more details.
More specifically:
# display available helpers
cowbird --help
# display available commands of 'services' helper
cowbird services --help
# display specific arguments and options of 'list' command of 'services' helper
cowbird services list --help
The cowbird
CLI should be available on your path directly following Installation of the package.
When using an conda
environment, you should activate it first to make the CLI available.
Source code of these helpers can be found here.
API Reference
This page contains auto-generated API reference documentation 1.
cowbird
Subpackages
cowbird.api
cowbird.api.home
cowbird.api.home.views
|
Cowbird API homepage. |
|
Version of the API. |
|
Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when |
|
-
cowbird.api.home.
get_logger
(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is
logging.NOTSET
.
cowbird.api.services
cowbird.api.services.views
|
List all registered services. |
|
Get service details. |
|
Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when |
|
-
cowbird.api.services.
get_logger
(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is
logging.NOTSET
.
cowbird.api.swagger
cowbird.api.swagger.views
|
Swagger UI route to display the Cowbird REST API schemas. |
|
Return JSON Swagger specifications of Cowbird REST API. |
|
Return JSON Swagger specifications of Cowbird REST API. |
|
Swagger UI route to display the Cowbird REST API schemas. |
|
Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when |
|
-
cowbird.api.swagger.
api_schema
(request: pyramid.request.Request) → cowbird.typedefs.JSON[source] Return JSON Swagger specifications of Cowbird REST API.
-
cowbird.api.swagger.
api_swagger
(request)[source] Swagger UI route to display the Cowbird REST API schemas.
-
cowbird.api.swagger.
get_logger
(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is
logging.NOTSET
.
cowbird.api.webhooks
cowbird.api.webhooks.views
|
|
|
User webhook used for created or removed user events. |
|
Permission webhook used for created or removed permission events. |
|
Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when |
|
-
cowbird.api.webhooks.
get_logger
(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is
logging.NOTSET
.
cowbird.api.exception
|
Evaluate various parameter combinations given the requested verification flags. Given a failing verification, |
|
Formats and applies the failing parameter conditions and results to returned JSON content according to flags. |
|
Evaluates the specified |
|
Returns successful HTTP with standardized information formatted with content type. (see |
|
Raises error HTTP with standardized information formatted with content type. |
|
Validates parameter types and formats required by |
|
Inserts the code, details, content and type within the body using json format. Includes also any other specified |
|
Attempts to rewrite the |
|
Formats the HTTP response content according to desired |
-
cowbird.api.exception.
verify_param
(param: Ellipsis, param_compare: Optional[Union[Any, List[Any]]] = None, param_name: Optional[str] = None, param_content: Optional[cowbird.typedefs.JSON] = None, with_param: bool = True, http_error: Type[pyramid.httpexceptions.HTTPError] = HTTPBadRequest, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, msg_on_fail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON, not_none: bool = False, not_empty: bool = False, not_in: bool = False, not_equal: bool = False, is_true: bool = False, is_false: bool = False, is_none: bool = False, is_empty: bool = False, is_in: bool = False, is_equal: bool = False, is_type: bool = False, matches: bool = False) → None[source] Evaluate various parameter combinations given the requested verification flags. Given a failing verification, directly raises the specified
http_error
. Invalid usage exceptions generated by this verification process are treated asHTTPInternalServerError
. Exceptions are generated using the standard output method.- Parameters
param – parameter value to evaluate
param_compare – Other value(s) to test
param
against. Can be an iterable (single value resolved as iterable unlessNone
). To test forNone
type, useis_none
/not_none
flags instead.param_name – name of the tested parameter returned in response if specified for debugging purposes
param_content – Additional JSON content to apply to generated error content on raise when
with_param
isTrue
. Must be JSON serializable. Provided content can override generated error parameter if matching fields.with_param – On raise, adds values of
param
,param_name
andparam_compare
, as well as additional failing conditions metadata to the JSON response body for each of the corresponding value.http_error – derived exception to raise on test failure (default:
HTTPBadRequest
)http_kwargs – additional keyword arguments to pass to
http_error
called in case of HTTP exceptionmsg_on_fail – message details to return in HTTP exception if flag condition failed
content – json formatted additional content to provide in case of exception
content_type – format in which to return the exception (one of
cowbird.common.SUPPORTED_ACCEPT_TYPES
)not_none – test that
param
is notNone
typenot_empty – test that
param
is not an empty iterable (string, list, set, etc.)not_in – test that
param
does not exist inparam_compare
valuesnot_equal – test that
param
is not equal toparam_compare
valueis_true – test that
param
isTrue
is_false – test that
param
isFalse
is_none – test that
param
isNone
typeis_empty – test param for an empty iterable (string, list, set, etc.)
is_in – test that
param
exists inparam_compare
valuesis_equal – test that
param
equalsparam_compare
valueis_type – test that
param
is of same type as specified byparam_compare
typematches – test that
param
matches the regex specified byparam_compare
value
- Raises
HTTPError – if tests fail, specified exception is raised (default:
HTTPBadRequest
)HTTPInternalServerError – for evaluation error
- Returns
nothing if all tests passed
-
cowbird.api.exception.
apply_param_content
(content: Ellipsis, param: Any, param_compare: Any, param_name: str, with_param: bool, param_content: Optional[cowbird.typedefs.JSON], needs_compare: bool, needs_iterable: bool, is_type: bool, fail_conditions: cowbird.typedefs.JSON) → cowbird.typedefs.JSON[source] Formats and applies the failing parameter conditions and results to returned JSON content according to flags.
See also
-
cowbird.api.exception.
evaluate_call
(call: Ellipsis, fallback: Optional[Callable[], None]] = None, http_error: Type[pyramid.httpexceptions.HTTPError] = HTTPInternalServerError, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, msg_on_fail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON) → Any[source] Evaluates the specified
call
with a wrapped HTTP exception handling. On failure, tries to call.fallback
if specified, and finally raises the specifiedhttp_error
.Any potential error generated by
fallback
orhttp_error
themselves are treated asHTTPInternalServerError
.Exceptions are generated using the standard output method formatted based on specified
content_type
.- Example:
normal call:
try: res = func(args) except Exception as exc: fb_func() raise HTTPExcept(exc.message)
wrapped call:
res = evaluate_call(lambda: func(args), fallback=lambda: fb_func(), http_error=HTTPExcept, **kwargs)
- Parameters
call – function to call, MUST be specified as lambda: <function_call>
fallback – function to call (if any) when call failed, MUST be lambda: <function_call>
http_error – alternative exception to raise on call failure
http_kwargs – additional keyword arguments to pass to http_error if called in case of HTTP exception
msg_on_fail – message details to return in HTTP exception if call failed
content – json formatted additional content to provide in case of exception
content_type – format in which to return the exception (one of cowbird.common.SUPPORTED_ACCEPT_TYPES)
- Raises
http_error – on call failure
HTTPInternalServerError – on fallback failure
- Returns
whichever return value call might have if no exception occurred
-
cowbird.api.exception.
valid_http
(http_success: Ellipsis = HTTPOk, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, detail: Optional[str] = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: Optional[str] = CONTENT_TYPE_JSON) → Union[pyramid.httpexceptions.HTTPSuccessful, pyramid.httpexceptions.HTTPRedirection][source] Returns successful HTTP with standardized information formatted with content type. (see
raise_http()
for HTTP error calls)- Parameters
http_success – any derived class from valid HTTP codes (<400) (default: HTTPOk)
http_kwargs – additional keyword arguments to pass to http_success when called
detail – additional message information (default: empty)
content – json formatted content to include
content_type – format in which to return the exception (one of cowbird.utils.SUPPORTED_ACCEPT_TYPES)
- Returns
formatted successful response with additional details and HTTP code
-
cowbird.api.exception.
raise_http
(http_error: Ellipsis = HTTPInternalServerError, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, detail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON, nothrow: bool = False) → NoReturn[source] Raises error HTTP with standardized information formatted with content type.
The content contains the corresponding http error code, the provided message as detail and optional specified additional json content (kwarg dict).
See also
valid_http()
for HTTP successful calls- Parameters
http_error – any derived class from base HTTPError (default: HTTPInternalServerError)
http_kwargs – additional keyword arguments to pass to http_error if called in case of HTTP exception
detail – additional message information (default: empty)
content – json formatted content to include
content_type – format in which to return the exception (one of cowbird.utils.SUPPORTED_ACCEPT_TYPES)
nothrow – returns the error response instead of raising it automatically, but still handles execution errors
- Raises
HTTPError – formatted raised exception with additional details and HTTP code
- Returns
HTTPError formatted exception with additional details and HTTP code only if nothrow is True
-
cowbird.api.exception.
validate_params
(http_class: Ellipsis, http_base: Union[Type[pyramid.httpexceptions.HTTPException], Iterable[Type[pyramid.httpexceptions.HTTPException]]], detail: str, content: Optional[cowbird.typedefs.JSON], content_type: str) → Tuple[int, str, cowbird.typedefs.JSON][source] Validates parameter types and formats required by
valid_http()
andraise_http()
.- Parameters
http_class – any derived class from base HTTPException to verify
http_base – any derived sub-class(es) from base HTTPException as minimum requirement for http_class (ie: 2xx, 4xx, 5xx codes). Can be a single class of an iterable of possible requirements (any).
detail – additional message information (default: empty)
content – json formatted content to include
content_type – format in which to return the exception (one of cowbird.utils.SUPPORTED_ACCEPT_TYPES)
- Raises
HTTPInternalServerError – if any parameter is of invalid expected format
- Returns http_code, detail, content
parameters with corrected and validated format if applicable
-
cowbird.api.exception.
format_content_json_str
(http_code, detail, content, content_type)[source] Inserts the code, details, content and type within the body using json format. Includes also any other specified json formatted content in the body. Returns the whole json body as a single string for output.
- Raises
HTTPInternalServerError – if parsing of the json content failed
- Returns
formatted json content as string with added HTTP code and details
-
cowbird.api.exception.
rewrite_content_type
(content: Union[str, cowbird.typedefs.JSON], content_type: str) → Tuple[str, Optional[cowbird.typedefs.JSON]][source] Attempts to rewrite the
type
field inserted by various functions such as:By applying the new value provided by
content_type
.- Returns
Content with rewritten “type” (if possible) and converted to string directly insertable to a response body. Also provides the converted JSON body if applicable (original content was literal JSON or JSON-like string).
-
cowbird.api.exception.
generate_response_http_format
(http_class: Type[pyramid.httpexceptions.HTTPException], http_kwargs: Optional[cowbird.typedefs.ParamsType], content: cowbird.typedefs.JSON, content_type: Optional[str] = CONTENT_TYPE_PLAIN, metadata: Optional[cowbird.typedefs.JSON] = None) → pyramid.httpexceptions.HTTPException[source] Formats the HTTP response content according to desired
content_type
using provided HTTP code and content.- Parameters
http_class – HTTPException derived class to use for output (code, generic title/explanation, etc.)
http_kwargs – additional keyword arguments to pass to http_class when called
content – formatted JSON content or literal string content providing additional details for the response
content_type – one of cowbird.utils.SUPPORTED_ACCEPT_TYPES (default: cowbird.utils.CONTENT_TYPE_PLAIN)
metadata – request metadata to add to the response body. (see:
cowbird.api.requests.get_request_info()
)
- Returns
http_class instance with requested information and content type if creation succeeds
- Raises
HTTPInternalServerError instance details about requested information and content type if creation fails
cowbird.api.generic
|
Overrides default HTTP. |
|
Overrides the default |
|
Guess the best applicable response |
|
Tween that validates that the specified request |
|
Tween that obtains the request |
|
Obtains additional exception content details about the |
|
Obtains additional content details about the |
-
cowbird.api.generic.
internal_server_error
(request: pyramid.request.Request) → pyramid.httpexceptions.HTTPException[source] Overrides default HTTP.
-
cowbird.api.generic.
not_found_or_method_not_allowed
(request: pyramid.request.Request) → pyramid.httpexceptions.HTTPException[source] Overrides the default
HTTPNotFound
[404] by appropriateHTTPMethodNotAllowed
[405] when applicable.Not found response can correspond to underlying process operation not finding a required item, or a completely unknown route (path did not match any existing API definition). Method not allowed is more specific to the case where the path matches an existing API route, but the specific request method (GET, POST, etc.) is not allowed on this path.
Without this fix, both situations return [404] regardless.
-
cowbird.api.generic.
guess_target_format
(request: pyramid.request.Request) → Tuple[str, bool][source] Guess the best applicable response
Content-Type
header according to requestAccept
header andformat
query, or defaulting toCONTENT_TYPE_JSON
.- Returns
tuple of matched MIME-type and where it was found (
True
: header,False
: query)
-
cowbird.api.generic.
validate_accept_header_tween
(handler: Callable[[pyramid.request.Request], pyramid.response.Response], registry: pyramid.registry.Registry) → Callable[[pyramid.request.Request], pyramid.response.Response][source] Tween that validates that the specified request
Accept
header orformat
query (if any) is a supported one by the application and for the given context.- Raises
HTTPNotAcceptable – if desired
Content-Type
is not supported.
-
cowbird.api.generic.
apply_response_format_tween
(handler: Callable[[pyramid.request.Request], pyramid.httpexceptions.HTTPException], registry: pyramid.registry.Registry) → Callable[[pyramid.request.Request], pyramid.response.Response][source] Tween that obtains the request
Accept
header orformat
query (if any) to generate the response with the desiredContent-Type
.The target
Content-Type
is expected to have been validated byvalidate_accept_header_tween()
beforehand to handle not-acceptable errors.The tween also ensures that additional request metadata extracted from
get_request_info()
is applied to the response body if not already provided by a previous operation.
-
cowbird.api.generic.
get_exception_info
(response: Union[pyramid.httpexceptions.HTTPException, pyramid.request.Request, pyramid.response.Response], content: Optional[cowbird.typedefs.JSON] = None, exception_details: bool = False) → cowbird.typedefs.JSON[source] Obtains additional exception content details about the
response
according to available information.
-
cowbird.api.generic.
get_request_info
(request: Union[pyramid.request.Request, pyramid.httpexceptions.HTTPException], default_message: Optional[str] = None, exception_details: bool = False) → cowbird.typedefs.JSON[source] Obtains additional content details about the
request
according to available information.
cowbird.api.requests
|
Validates the value against specified type and pattern. |
|
|
|
Obtains the value of |
|
Obtains and validates the matched value under |
|
Obtains the matched value located at the expected position of the specified path variable. |
|
Retrieves a query string value by name (case insensitive), or returns the default if not present. |
-
cowbird.api.requests.
check_value
(value: Any, param_name: str, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None) → None[source] Validates the value against specified type and pattern.
- Parameters
value – value to validate.
check_type – verify that parameter value is of specified type. Set to
None
to disable check.pattern – regex pattern to validate the input with. If value evaluates to
False
, skip this kind of validation (default:ax.PARAM_REGEX
).param_name – path variable key.
http_error – derived exception to raise on check failure (default:
HTTPUnprocessableEntity
)msg_on_fail – message details to return in HTTP exception if check failed (default: description message of
UnprocessableEntityResponseSchema
).
- Returns
None.
- Raises
HTTPError – if the key is not an applicable path variable for this request.
-
cowbird.api.requests.
get_multiformat_body_raw
(request: pyramid.request.Request, key: str, default: Optional[Any] = None) → Any[source] Obtains the value of
key
element from the request body according to specified Content-Type header.See also
-
cowbird.api.requests.
get_multiformat_body
(request: pyramid.request.Request, key: str, default: Any = None, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None) → str[source] Obtains and validates the matched value under
key
element from the request body.Parsing of the body is accomplished according to
Content-Type
header.- Parameters
request – request from which to retrieve the key.
key – body key variable.
default – value to return instead if not found. If this default is
None
, it will raise.check_type – verify that parameter value is of specified type. Set to
None
to disable check.pattern – regex pattern to validate the input with. If value evaluates to
False
, skip this kind of validation (default:cowbird.api.exception.PARAM_REGEX
).http_error – derived exception to raise on check failure (default:
HTTPUnprocessableEntity
)msg_on_fail – message details to return in HTTP exception if check failed (default: description message of
UnprocessableEntityResponseSchema
).
- Returns
matched path variable value.
- Raises
HTTPBadRequest – if the key could not be retrieved from the request body and has no provided default value.
HTTPUnprocessableEntity – if the retrieved value from the key is invalid for this request.
See also
-
cowbird.api.requests.
get_path_param
(request: pyramid.request.Request, key: str, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None) → str[source] Obtains the matched value located at the expected position of the specified path variable.
- Parameters
request – request from which to retrieve the key.
key – path variable key.
check_type – verify that parameter value is of specified type. Set to
None
to disable check.pattern – regex pattern to validate the input with. If value evaluates to
False
, skip this kind of validation (default:ax.PARAM_REGEX
).http_error – derived exception to raise on check failure (default:
HTTPUnprocessableEntity
)msg_on_fail – message details to return in HTTP exception if check failed (default: description message of
UnprocessableEntityResponseSchema
).
- Returns
matched path variable value.
- Raises
HTTPError – if the key is not an applicable path variable for this request.
cowbird.api.schemas
Valid values as webhook event. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
Fundamental building block of schemas. |
|
|
|
Employed to simplify Pyramid route and view config definitions from same schema objects. |
|
Return JSON Swagger specifications of Cowbird REST API. |
-
cowbird.api.schemas.
service_api_route_info
(service_api, **kwargs)[source] Employed to simplify Pyramid route and view config definitions from same schema objects.
-
class
cowbird.api.schemas.
ValidOperations
[source] Bases:
cowbird.utils.ExtendedEnum
Valid values as webhook event.
-
cowbird.api.schemas.
generate_api_schema
(swagger_base_spec: Dict[str, Union[str, List[str]]]) → cowbird.typedefs.JSON[source] Return JSON Swagger specifications of Cowbird REST API.
Uses Cornice Services and Schemas to return swagger specification.
- Parameters
swagger_base_spec – dictionary that specifies the ‘host’ and list of HTTP ‘schemes’ to employ.
-
class
cowbird.api.schemas.
Service_RequestPathSchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
AcceptType
(*arg, **kw)[source] Bases:
colander.SchemaNode
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ContentType
(*arg, **kw)[source] Bases:
colander.SchemaNode
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
RequestHeaderSchemaAPI
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
RequestHeaderSchemaUI
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
QueryRequestSchemaAPI
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
BaseRequestSchemaAPI
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
HeaderResponseSchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
BaseResponseSchemaAPI
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
BaseResponseBodySchema
(code, description, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ErrorVerifyParamConditions
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ErrorVerifyParamBodySchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ErrorFallbackBodySchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ErrorCallBodySchema
(*arg, **kw)[source] Bases:
ErrorFallbackBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ErrorResponseBodySchema
(code, description, **kw)[source] Bases:
BaseResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
InternalServerErrorResponseBodySchema
(**kw)[source] Bases:
ErrorResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
BadRequestResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
Bases:
ErrorResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
HTTPForbiddenResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
NotFoundResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
MethodNotAllowedResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
NotAcceptableResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
UnprocessableEntityResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
InternalServerErrorResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
PermissionSchema
(*arg, **kw)[source] Bases:
colander.SchemaNode
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
PermissionListSchema
(*args, **kw)[source] Bases:
colander.SequenceSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ResourceSchema
(*arg, **kw)[source] Bases:
colander.SchemaNode
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ResourceListSchema
(*args, **kw)[source] Bases:
colander.SequenceSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ServiceSummarySchema
(*arg, **kw)[source] Bases:
colander.SchemaNode
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ServiceListSchema
(*args, **kw)[source] Bases:
colander.SequenceSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ServiceConfigurationSchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
ServiceDetailSchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_GET_RequestSchema
(*arg, **kw)[source] Bases:
BaseRequestSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_GET_ResponseBodySchema
(code, description, **kw)[source] Bases:
BaseResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_GET_OkResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_GET_BadRequestResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_RequestBodySchema
(*arg, **kw)[source] Bases:
ServiceDetailSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_RequestSchema
(*arg, **kw)[source] Bases:
BaseRequestSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_CreatedResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_BadRequestResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_SummaryBodyResponseSchema
(code, description, **kw)[source] Bases:
BaseResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_GET_RequestSchema
(*arg, **kw)[source] Bases:
BaseRequestSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_GET_ResponseBodySchema
(code, description, **kw)[source] Bases:
BaseResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_GET_OkResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_GET_NotFoundResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_ForbiddenResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_ConflictResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_UnprocessableEntityResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Services_POST_InternalServerErrorResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_RequestBodySchema
(*arg, **kw)[source] Bases:
ServiceDetailSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_RequestSchema
(*arg, **kw)[source] Bases:
BaseRequestSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_ResponseBodySchema
(code, description, **kw)[source] Bases:
Service_GET_ResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_OkResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_BadRequestResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_ForbiddenResponseSchema_ReservedKeyword
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_ForbiddenResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Service_PATCH_UnprocessableEntityResponseSchema
(*arg, **kw)[source] Bases:
Services_POST_UnprocessableEntityResponseSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
UserWebhook_POST_RequestBodySchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
UserWebhook_POST_RequestSchema
(*arg, **kw)[source] Bases:
BaseRequestSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
UserWebhook_POST_BadRequestResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
UserWebhook_POST_OkResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
PermissionWebhook_POST_RequestBodySchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
PermissionWebhook_POST_RequestSchema
(*arg, **kw)[source] Bases:
BaseRequestSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
PermissionWebhook_POST_BadRequestResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
PermissionWebhook_POST_OkResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Version_GET_ResponseBodySchema
(code, description, **kw)[source] Bases:
BaseResponseBodySchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Version_GET_OkResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
Homepage_GET_OkResponseSchema
(*arg, **kw)[source] Bases:
BaseResponseSchemaAPI
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
-
class
cowbird.api.schemas.
SwaggerAPI_GET_OkResponseSchema
(*arg, **kw)[source] Bases:
colander.MappingSchema
Fundamental building block of schemas.
The constructor accepts these positional arguments:
typ
: The ‘type’ for this node. It should be an instance of a class that implements thecolander.interfaces.Type
interface. Iftyp
is not passed, a call to theschema_type()
method on this class is made to get a default type. (When subclassing,schema_type()
should be overridden to provide a reasonable default type).*children
: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via theadd
method.
The constructor accepts these keyword arguments:
name
: The name of this node.typ
: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.default
: The default serialization value for this node when not set. Ifdefault
iscolander.drop
, the node will be dropped from schema serialization. If not provided, the node will be serialized tocolander.null
.missing
: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker valuecolander.required
, indicating that it is considered ‘required’. Whenmissing
iscolander.required
, therequired
computed attribute will beTrue
. Whenmissing
iscolander.drop
, the node is dropped from the schema if it isn’t set during deserialization.missing_msg
: Optional error message to be used if the value is required and missing.preparer
: Optional preparer for this node. It should be an object that implements thecolander.interfaces.Preparer
interface.validator
: Optional validator for this node. It should be an object that implements thecolander.interfaces.Validator
interface.after_bind
: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of thebind
method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so theafter_bind
methods of the deepest nodes are called before the shallowest. Theafter_bind
callback should accept two values:node
andkw
.node
will be a clone of the bound node object,kw
will be the set of keywords passed to thebind
method.title
: The title of this node. Defaults to a titleization of thename
(underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).description
: The description for this node. Defaults to''
(the empty string). The description is used by higher-level systems (not by Colander itself).widget
: The ‘widget’ for this node. Defaults toNone
. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.insert_before
: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.
Arbitrary keyword arguments remaining will be attached to the node object unmolested.
|
Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when |
|
Include API sub-modules. |
-
cowbird.api.
get_logger
(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is
logging.NOTSET
.
cowbird.cli
cowbird.cli.services
Cowbird CLI helper to execute service operations.
|
|
|
-
cowbird.cli.services.
make_parser
(shared_parsers: cowbird.cli.utils.SharedParsers = None, prefixes: cowbird.cli.utils.CommandPrefixes = None) → argparse.ArgumentParser[source]
cowbird.cli.utils
|
Generates both fields with the same description as each parameter is used in different context. |
|
|
|
|
|
|
|
|
|
-
cowbird.cli.utils.
subparser_help
(description: str, parent_parser: Optional[argparse.ArgumentParser] = None) → Dict[str, str][source] Generates both fields with the same description as each parameter is used in different context.
Field
help
is printed next to the subparser name when parent parser is called with--help
. Fielddescription
populates the help details under the usage command when calling child parser--help
.
|
|
|
Generates both fields with the same description as each parameter is used in different context. |
|
Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when |
|
Automatically groups all sub-helper CLI listed in |
-
cowbird.cli.
subparser_help
(description: str, parent_parser: Optional[argparse.ArgumentParser] = None) → Dict[str, str][source] Generates both fields with the same description as each parameter is used in different context.
Field
help
is printed next to the subparser name when parent parser is called with--help
. Fielddescription
populates the help details under the usage command when calling child parser--help
.
-
cowbird.cli.
get_logger
(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is
logging.NOTSET
.
-
cowbird.cli.
main
(args=None)[source] Automatically groups all sub-helper CLI listed in
cowbird.cli
as a commoncowbird
CLI entrypoint.Dispatches the provided arguments to the appropriate sub-helper CLI as requested. Each sub-helper CLI must implement functions
make_parser
andmain
to generate the arguments and dispatch them to the corresponding caller.
cowbird.database
Database package for pyramid.
Add the database in the pyramid registry and a property db for the requests.
cowbird.database.base
Return the unique identifier of db type matching settings. |
-
class
cowbird.database.base.
DatabaseInterface
(_)[source] Return the unique identifier of db type matching settings.
Database interface defining a minimum set of function mostly around store management.
cowbird.database.mongodb
Return the unique identifier of db type matching settings. |
|
Obtains the basic database connection from settings. |
|
Obtains the database with configuration ready for usage. |
-
class
cowbird.database.mongodb.
MongoDatabase
(container)[source] Bases:
cowbird.database.base.DatabaseInterface
Return the unique identifier of db type matching settings.
Initialize the mongo database from various type of container.
-
get_store
(self: Union[str, Type[cowbird.database.stores.StoreInterface], AnyMongodbStoreType], store_type: Any, *store_args: Any, **store_kwargs) → AnyMongodbStore[source] Retrieve a store from the database.
- Parameters
store_type – type of the store to retrieve/create.
store_args – additional arguments to pass down to the store.
store_kwargs – additional keyword arguments to pass down to the store.
-
cowbird.database.stores
Stores to read/write data to from/to MongoDB using pymongo.
Check that the store implementation defines its type and index_fields. |
|
Base class extended by all concrete store implementations. |
|
Registry for monitoring instances. |
-
class
cowbird.database.stores.
StoreInterface
[source] Bases:
object
Check that the store implementation defines its type and index_fields.
-
class
cowbird.database.stores.
MongodbStore
(collection: Optional[Dict[str, Any]])[source] Base class extended by all concrete store implementations.
Validate and hold the collection for all the implementation.
-
classmethod
get_args_kwargs
(cls: Any, *args: Any, **kwargs) → Tuple[Tuple, Dict][source] Filters
MongodbStore
-specific arguments to safely pass them down its__init__
.
-
classmethod
-
class
cowbird.database.stores.
MonitoringStore
(*args, **kwargs)[source] Bases:
StoreInterface
,MongodbStore
Registry for monitoring instances.
Uses MongoDB to store what is monitored and by whom.
Init the store used to save monitors.
-
save_monitor
(self: cowbird.monitoring.monitor.Monitor, monitor) → None[source] Stores Monitor in MongoDB storage.
-
delete_monitor
(self: cowbird.monitoring.monitor.Monitor, monitor) → None[source] Removes Monitor from MongoDB storage.
-
list_monitors
(self) → List[cowbird.monitoring.monitor.Monitor][source] Lists all Monitor in MongoDB storage.
-
Return the unique identifier of db type matching settings. |
|
Retrieves the application |
|
Retrieve application settings from a supported container. |
|
Obtains the database connection from configured application settings. |
|
-
class
cowbird.database.
MongoDatabase
(container)[source] Bases:
cowbird.database.base.DatabaseInterface
Return the unique identifier of db type matching settings.
Initialize the mongo database from various type of container.
-
_database
-
_settings
-
_stores
-
type
= mongodb
-
reset_store
(self, store_type)
-
get_store
(self: Union[str, Type[cowbird.database.stores.StoreInterface], AnyMongodbStoreType], store_type: Any, *store_args: Any, **store_kwargs) → AnyMongodbStore Retrieve a store from the database.
- Parameters
store_type – type of the store to retrieve/create.
store_args – additional arguments to pass down to the store.
store_kwargs – additional keyword arguments to pass down to the store.
-
get_session
(self: Ellipsis) → Any
-
get_information
(self: Ellipsis) → cowbird.typedefs.JSON - Returns
{‘version’: version, ‘type’: db_type}
-
is_ready
(self: Ellipsis) → bool
-
-
cowbird.database.
get_registry
(container: cowbird.typedefs.AnyRegistryContainer, nothrow: bool = False) → Optional[pyramid.registry.Registry][source] Retrieves the application
registry
from various containers referencing to it.
-
cowbird.database.
get_settings
(container: Optional[cowbird.typedefs.AnySettingsContainer], app: bool = False) → cowbird.typedefs.SettingsType[source] Retrieve application settings from a supported container.
- Parameters
container – supported container with an handle to application settings.
app – allow retrieving from current thread registry if no container was defined.
- Returns
found application settings dictionary.
- Raises
TypeError – when no application settings could be found or unsupported container.
-
cowbird.database.
get_db
(container: cowbird.typedefs.AnySettingsContainer, reset_connection: bool = False) → mongodb.MongoDatabase[source] Obtains the database connection from configured application settings.
If
reset_connection
isTrue
, thecontainer
must be the applicationRegistry
or any container that can retrieve it to accomplish reference reset. Otherwise, any settings container can be provided.
cowbird.monitoring
cowbird.monitoring.fsmonitor
Interface being called when something changes on the filesystem. |
-
class
cowbird.monitoring.fsmonitor.
FSMonitor
[source] Bases:
abc.ABC
Interface being called when something changes on the filesystem.
-
abstract static
get_instance
()[source] Must return an instance of the class implementing FSMonitor.
-
abstract
on_created
(self: str, filename) → None[source] Call when a new file is found.
- Parameters
filename – Relative filename of a new file
-
abstract static
cowbird.monitoring.monitor
Implementation of the watchdog |
-
exception
cowbird.monitoring.monitor.
MonitorException
[source] Bases:
Exception
Error indicating that a
Monitor
cannot be started because of an invalid path or callback.Initialize self. See help(type(self)) for accurate signature.
-
class
cowbird.monitoring.monitor.
Monitor
(path: bool, recursive: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str], callback)[source] Bases:
watchdog.events.FileSystemEventHandler
Implementation of the watchdog
FileSystemEventHandler
class Allows to start/stop directory monitoring and send events toFSMonitor
callback.Initialize the path monitoring and ready to be started.
@param path: Path to monitor @param recursive: Monitor subdirectory recursively? @param callback: Events are sent to this FSMonitor.
Can be an object, a class type implementing
FSMonitor
or a string containing module and class name. The class type or string is used to instantiate an object using the class methodFSMonitor.get_instance()
-
static
get_fsmonitor_instance
(callback: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str]) → cowbird.monitoring.fsmonitor.FSMonitor[source] Return a
FSMonitor
instance from multiple possible forms including theFSMonitor
type, theFSMonitor
full qualified class name or a direct instance which is returned as is.
-
static
get_qualified_class_name
(monitor: cowbird.monitoring.fsmonitor.FSMonitor) → str[source] Returns the full qualified class name of the
FSMonitor
object (string of the form module.class_name)
-
property
key
(self) → Dict[source] Return a dict that can be used as a unique key to identify this
Monitor
in a BD.
-
params
(self) → Dict[source] Return a dict serializing this object from which a new
Monitor
can be recreated using the init function.
-
on_moved
(self: Union[watchdog.events.DirMovedEvent, watchdog.events.FileMovedEvent], event) → None[source] Called when a file or a directory is moved or renamed.
@param event: Event representing file/directory movement.
-
on_created
(self: Union[watchdog.events.DirCreatedEvent, watchdog.events.FileCreatedEvent], event) → None[source] Called when a file or directory is created.
@param event: Event representing file/directory creation.
-
static
cowbird.monitoring.monitoring
Class handling file system monitoring and registering listeners. |
-
class
cowbird.monitoring.monitoring.
Monitoring
(config=None)[source] Class handling file system monitoring and registering listeners.
Todo
At some point we will need a consistency function that goes through all monitored folder and make sure that monitoring services are up to date.
Initialize the monitoring instance from configured application settings.
- @param config: AnySettingsContainer object from which the db can be retrieved.
The default value of None is only there to disable pylint E1120. The singleton instance must be initialized with a proper config and after that the init function should not be hit.
-
register
(self: str, path: bool, recursive: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str], cb_monitor) → cowbird.monitoring.monitor.Monitor[source] Register a monitor for a specific path and start it. If a monitor already exists for the specific path/cb_monitor combination it is directly returned. If this monitor was not recursively monitoring its path and the recursive flag is now true, this one take precedence and the monitor is updated accordingly. If the recursive flag was true and now it is false it has no effect.
@param path: Path to monitor @param recursive: Monitor subdirectory recursively? @param cb_monitor: FSMonitor for which an instance is created and events are sent
Can be an object, a class type implementing FSMonitor or a string containing module and class name.
@return The monitor registered or already existing for the specific path/cb_monitor combination.
-
unregister
(self: str, path: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str], cb_monitor) → bool[source] Stop a monitor and unregister it.
@param path: Path used by the monitor @param cb_monitor: FSMonitor object to remove
Can be an object, a class type implementing FSMonitor or a string containing module and class name.
@return: True if the monitor is found and successfully stopped, False otherwise
cowbird.services
cowbird.services.impl
cowbird.services.impl.catalog
-
class
cowbird.services.impl.catalog.
Catalog
(settings: str, name: dict, **kwargs)[source] Bases:
cowbird.services.service.Service
,cowbird.monitoring.fsmonitor.FSMonitor
Keep the catalog index in sync when files are created/deleted/updated.
Create the catalog instance.
@param settings: Cowbird settings for convenience @param name: Service name
-
abstract
get_resource_id
(self, resource_full_name)[source] Each service must provide this implementation required by the permission synchronizer.
The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.
-
static
get_instance
()[source] Return the Catalog singleton instance from the class name used to retrieve the FSMonitor from the DB.
-
on_created
(self, filename)[source] Call when a new file is found.
- Parameters
filename – Relative filename of a new file
-
abstract
cowbird.services.impl.filesystem
Keep the proper directory structure in sync with the platform. |
-
class
cowbird.services.impl.filesystem.
FileSystem
(settings: str, name: dict, **kwargs)[source] Bases:
cowbird.services.service.Service
Keep the proper directory structure in sync with the platform.
Create the file system instance.
@param settings: Cowbird settings for convenience @param name: Service name
-
abstract
get_resource_id
(self, resource_full_name)[source] Each service must provide this implementation required by the permission synchronizer.
The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.
-
abstract
cowbird.services.impl.geoserver
Decorator for response and logging handling for the different Geoserver HTTP requests. |
|
|
|
|
|
|
|
|
|
|
|
|
-
cowbird.services.impl.geoserver.
geoserver_response_handling
(func)[source] Decorator for response and logging handling for the different Geoserver HTTP requests.
@param func : Function executing a http request to Geoserver @return : Response object
-
class
cowbird.services.impl.geoserver.
Geoserver
(settings: str, name: dict, **kwargs)[source] Bases:
cowbird.services.service.Service
,cowbird.monitoring.fsmonitor.FSMonitor
Keep Geoserver internal representation in sync with the platform.
Create the geoserver service instance.
@param settings: Cowbird settings for convenience @param name: Service name
-
abstract
get_resource_id
(self: str, resource_full_name) → str[source] Each service must provide this implementation required by the permission synchronizer.
The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.
-
static
get_instance
()[source] Return the Geoserver singleton instance from the class name used to retrieve the FSMonitor from the DB.
-
on_created
(self, filename)[source] Call when a new file is found.
- Parameters
filename – Relative filename of a new file
-
on_deleted
(self, filename)[source] Call when a file is deleted.
- Parameters
filename – Relative filename of the removed file
-
on_modified
(self: str, filename) → None[source] Call when a file is updated.
- Parameters
filename – Relative filename of the updated file
-
create_workspace
(self: Geoserver, name: str) → None[source] Create a new Geoserver workspace.
@param name: Workspace name
-
remove_workspace
(self: Geoserver, name: str) → None[source] Removes a workspace from geoserver. Will also remove all datastores associated with the workspace.
@param name: Workspace name
-
create_datastore
(self: Geoserver, workspace_name: str) → None[source] Create a new Geoserver workspace.
@param self: Geoserver instance @param workspace_name: Workspace name where the datastore must be created
-
publish_shapefile
(self: Geoserver, workspace_name: str, shapefile_name: str) → None[source] Publish a shapefile in the specified workspace.
@param workspace_name: Name of the workspace from which the shapefile will be published @param shapefile_name: The shapefile’s name, without file extension
-
validate_shapefile
(self, workspace_name, shapefile_name)[source] Validate shapefile. Will look for the three other files necessary for Geoserver publishing (.prj, .dbf, .shx) and raise a FileNotFoundError exception if one is missing.
@param workspace_name: Name of the workspace from which the shapefile will be published @param shapefile_name: The shapefile’s name, without file extension
-
remove_shapefile
(self: Geoserver, workspace_name: str, filename: str) → None[source] Remove a shapefile from the specified workspace.
@param workspace_name: Name of the workspace from which the shapefile will be removed @param filename: The shapefile’s name, without file extension
-
static
_get_shapefile_info
(filename: str) → Tuple[str, str][source] @param filename: Relative filename of a new file @return: Workspace name (str) where file is located and shapefile name (str)
-
static
_get_datastore_name
(workspace_name: str) → str[source] Return datastore name used to represent the datastore inside Geoserver.
To be used in the HTTP requests sent to Geoserver. This name does not exist on the file system.
-
_shapefile_folder_dir
(self: str, workspace_name) → str[source] Returns the path to the user’s shapefile datastore inside the file system.
-
static
_geoserver_user_datastore_dir
(user_name: str) → str[source] Returns the path to the user’s shapefile datastore inside the Geoserver instance container, ie.
where the WORKSPACE_DIR env variable is mapped in the Geoserver container.
-
_create_workspace_request
(self: Geoserver, workspace_name: str) → requests.Response[source] Request to create a new workspace.
@param workspace_name: Name of workspace to be created @return: Response object
-
_remove_workspace_request
(self: Geoserver, workspace_name: str) → requests.Response[source] Request to remove workspace and all associated datastores and layers.
@param workspace_name: Name of workspace to remove @return: Response object
-
_create_datastore_request
(self: Geoserver, workspace_name: str, datastore_name: str) → requests.Response[source] Initial creation of the datastore with no connection parameters.
@param workspace_name: Name of the workspace in which the datastore is created @param datastore_name: Name of the datastore that will be created @return: Response object
-
_configure_datastore_request
(self: Geoserver, workspace_name: str, datastore_name: str, datastore_path: str) → requests.Response[source] Configures the connection parameters of the datastore.
This is done as a secondary step because Geoserver tends to create the wrong type of datastore (shapefile instead of directory of shapefiles) when setting them at creation.
@param workspace_name: Name of the workspace in which the datastore is created @param datastore_name: Name of the datastore that will be created @return: Response object
-
_publish_shapefile_request
(self: Geoserver, workspace_name: str, datastore_name: str, filename: str) → requests.Response[source] Request to publish a shapefile in Geoserver. Does so by creating a Feature type in Geoserver.
@param workspace_name: Workspace where file will be published @param datastore_name: Datastore where file will be published @param filename: Name of the shapefile (with no extentions) @return: Response object
-
_remove_shapefile_request
(self: Geoserver, workspace_name: str, datastore_name: str, filename: str) → requests.Response[source] Request to remove specified Geoserver Feature type and corresponding layer.
@param workspace_name: Workspace where file is published @param datastore_name: Datastore where file is published @param filename: Name of the shapefile (with no extentions) @return: Response object
-
abstract
cowbird.services.impl.magpie
Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when |
-
class
cowbird.services.impl.magpie.
Magpie
(settings: str, name: dict, **kwargs)[source] Bases:
cowbird.services.service.Service
Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when permissions are updated for one of them.
** Cowbird components diagram 1.2.0 needs to be update since Magpie can handle permissions synchronisation directly on permission update events. No need to handle them explicitly in nginx, thredds and geoserver classes.
Create the magpie instance and instantiate the permission synchronizer that will handle the permission events.
@param settings: Cowbird settings for convenience @param name: Service name
-
abstract
get_resource_id
(self, resource_full_name)[source] Each service must provide this implementation required by the permission synchronizer.
The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.
-
create_permission
(self: cowbird.permissions_synchronizer.Permission, permission) → None[source] Make sure that the specified permission exists on Magpie.
Todo
First need to check if the permission already exists If the permission doesn’t exist do a POST to create it If the permission exists but is different do a PUT to update it
-
delete_permission
(self: cowbird.permissions_synchronizer.Permission, permission) → None[source] Remove the specified permission from Magpie if it exists.
-
abstract
cowbird.services.impl.nginx
Nothing to do right now. |
-
class
cowbird.services.impl.nginx.
Nginx
(settings: str, name: dict, **kwargs)[source] Bases:
cowbird.services.service.Service
Nothing to do right now.
Create the nginx instance.
@param settings: Cowbird settings for convenience @param name: Service name
-
abstract
get_resource_id
(self, resource_full_name)[source] Each service must provide this implementation required by the permission synchronizer.
The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.
-
abstract
cowbird.services.impl.thredds
Nothing to do right now. |
-
class
cowbird.services.impl.thredds.
Thredds
(settings: str, name: dict, **kwargs)[source] Bases:
cowbird.services.service.Service
Nothing to do right now.
Create the thredds instance.
@param settings: Cowbird settings for convenience @param name: Service name
-
abstract
get_resource_id
(self, resource_full_name)[source] Each service must provide this implementation required by the permission synchronizer.
The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.
-
abstract
cowbird.services.service
-
exception
cowbird.services.service.
ServiceConfigurationException
[source] Bases:
Exception
Exception thrown when a service cannot be instantiated because of a bad configuration.
Initialize self. See help(type(self)) for accurate signature.
-
class
cowbird.services.service.
Service
(settings: str, name: dict, **kwargs)[source] Bases:
abc.ABC
Helper class that provides a standard way to create an ABC using inheritance.
@param settings: Cowbird settings for convenience @param name: Service name @param kwargs: The base class handle, but doesn’t require the following variables:
- param priority: Relative priority between services while handling events
(lower value has higher priority, default value is last)
param url: Location of the web service represented by the cowbird service param workspace_dir:
-
__slots__
[source] Service interface used to notify implemented services of users/permissions changes.
Todo
At some point we will need a consistency function that goes through all Magpie users and make sure that services are up to date.
-
abstract
get_resource_id
(self, resource_full_name)[source] Each service must provide this implementation required by the permission synchronizer.
The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.
cowbird.services.service_factory
Create service instance using service name. |
-
cowbird.services.service_factory.
VALID_SERVICES
= ['Catalog', 'Geoserver', 'Magpie', 'Nginx', 'Thredds', 'FileSystem'][source]
-
class
cowbird.services.service_factory.
ServiceFactory
[source] Create service instance using service name.
-
get_service
(self: ServiceFactory, name: str) → cowbird.services.service.Service[source] Instantiates a Service implementation using its name if it doesn’t exist or else returns the existing one from cache.
-
get_active_services
(self: ServiceFactory) → List[cowbird.services.service.Service][source] Return a sorted list by priority of Service implementation activated in the config.
-
Create service instance using service name. |
|
Obtains the services managed by the application. |
-
class
cowbird.services.
ServiceFactory
[source] Create service instance using service name.
-
get_service
(self: ServiceFactory, name: str) → cowbird.services.service.Service Instantiates a Service implementation using its name if it doesn’t exist or else returns the existing one from cache.
-
get_active_services
(self: ServiceFactory) → List[cowbird.services.service.Service] Return a sorted list by priority of Service implementation activated in the config.
-
-
cowbird.services.
get_services
(container: cowbird.typedefs.AnySettingsContainer) → List[service.Service][source] Obtains the services managed by the application.
Submodules
cowbird.__meta__
General meta information on the package.
cowbird.app
Cowbird is a middleware that manages interactions between various birds of the bird-house stack.
|
This function returns the Pyramid WSGI application. |
|
This function returns the Pyramid WSGI application. |
cowbird.config
|
Loads a file path or dictionary as YAML/JSON configuration. |
|
Loads all configuration files specified by the path (if a directory), |
|
Applies environment variable expansion recursively to all applicable fields of a configuration definition. |
-
exception
cowbird.config.
ConfigError
[source] Bases:
RuntimeError
Generic error during configuration loading.
Initialize self. See help(type(self)) for accurate signature.
-
cowbird.config.
_load_config
(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False) → cowbird.typedefs.ConfigDict[source] Loads a file path or dictionary as YAML/JSON configuration.
-
cowbird.config.
get_all_configs
(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False) → List[cowbird.typedefs.ConfigDict][source] Loads all configuration files specified by the path (if a directory), a single configuration (if a file) or directly returns the specified dictionary section (if a configuration dictionary). :returns:
list of configurations loaded if input was a directory path
list of single configuration if input was a file path
list of single configuration if input was a JSON dict
empty list if none of the other cases where matched
Note
Order of file loading will be resolved by alphabetically sorted filename if specifying a directory path.
cowbird.constants
Constant settings for Cowbird application.
Constants defined with format COWBIRD_[VARIABLE_NAME]
can be matched with corresponding
settings formatted as cowbird.[variable_name]
in the cowbird.ini
configuration file.
Note
Since the cowbird.ini
file has to be loaded by the application to retrieve various configuration settings,
constant COWBIRD_INI_FILE_PATH
(or any other path variable defined before it - see below) has to be defined
by environment variable if the default location is not desired (ie: if you want to provide your own configuration).
Get logging level from INI configuration file or fallback to default |
|
Find the equivalent setting name of the provided environment variable name. |
|
|
Search in order for matched value of |
|
Validates that some value is provided for every mandatory configuration setting. |
-
cowbird.constants.
_get_default_log_level
()[source] Get logging level from INI configuration file or fallback to default
INFO
if it cannot be retrieved.
-
cowbird.constants.
COWBIRD_CONSTANTS
= ['COWBIRD_CONSTANTS', 'COWBIRD_MODULE_DIR', 'COWBIRD_ROOT', 'COWBIRD_ADMIN_PERMISSION'][source]
-
cowbird.constants.
get_constant_setting_name
(name)[source] Find the equivalent setting name of the provided environment variable name.
Lower-case name and replace all non-ascii chars by _. Then, convert known prefixes with their dotted name.
-
cowbird.constants.
get_constant
(constant_name: Ellipsis, settings_container: Optional[cowbird.typedefs.AnySettingsContainer] = None, settings_name: Optional[str] = None, default_value: Optional[cowbird.typedefs.SettingValue] = None, raise_missing: bool = True, print_missing: bool = False, raise_not_set: bool = True) → cowbird.typedefs.SettingValue[source] - Search in order for matched value of
constant_name
: search in
COWBIRD_CONSTANTS
search in settings if specified
search alternative setting names (see below)
search in
cowbird.constants
definitionssearch in environment variables
Parameter
constant_name
is expected to have the formatCOWBIRD_[VARIABLE_NAME]
although any value can be passed to retrieve generic settings from all above mentioned search locations.If
settings_name
is provided as alternative name, it is used as is to search for results ifconstant_name
was not found. Otherwise,cowbird.[variable_name]
is used for additional search when the formatCOWBIRD_[VARIABLE_NAME]
was used forconstant_name
(i.e.:COWBIRD_ADMIN_USER
will also search forcowbird.admin_user
and so on for corresponding constants).- Parameters
constant_name – key to search for a value
settings_container – WSGI application settings container (if not provided, uses found one in current thread)
settings_name – alternative name for settings if specified
default_value – default value to be returned if not found anywhere, and exception raises are disabled.
raise_missing – raise exception if key is not found anywhere
print_missing – print message if key is not found anywhere, return
None
raise_not_set – raise an exception if the found key is
None
, search until last case if others areNone
- Returns
found value or default_value
- Raises
ValueError – if resulting value is invalid based on options (by default raise missing/
None
value)LookupError – if no appropriate value could be found from all search locations (according to options)
- Search in order for matched value of
cowbird.permissions_synchronizer
Define every property required to set a permission in Magpie. |
|
A sync point contain services sharing resources via multiple API. |
|
Keep service-shared resources in sync when permissions are updated for one of them. |
-
class
cowbird.permissions_synchronizer.
Permission
(service_name: str, resource_id: str, resource_full_name: str, name: str, access: str, scope: str, user: str = None, group: str = None)[source] Define every property required to set a permission in Magpie.
-
__eq__
(self: Permission, other) → bool[source] Return self==value.
-
-
class
cowbird.permissions_synchronizer.
SyncPoint
(services: SyncPointServicesType, mapping: SyncPointMappingType)[source] A sync point contain services sharing resources via multiple API.
It defines how the same resource is defined in each service and what are the mapping between permission accesses.
Init the sync point, holding services with their respective resources root and how access are mapped between them.
@param services: Dict, where the service is the key and its resources root is the value @param mapping: List of dict where the service is the key and an access list is the value
-
resource_match
(self: Permission, permission) → bool[source] Define if the permission name is covered by this sync point.
-
find_match
(self: Permission, permission) → Generator[Tuple[str, str], None, None][source] Search and yield for every match a (service, permission name) tuple that is mapped with this permission.
-
sync
(self: Callable[Permission], perm_operation: Permission, permission) → None[source] Create or delete the same permission on each service sharing the same resource.
@param perm_operation Magpie create_permission or delete_permission function @param permission Permission to synchronize with others services
-
-
class
cowbird.permissions_synchronizer.
PermissionSynchronizer
(magpie_inst)[source] Bases:
object
Keep service-shared resources in sync when permissions are updated for one of them.
Todo
At some point we will need a consistency function that goes through all permissions of all services and make sure that linked services have the same permissions.
-
create_permission
(self: Permission, permission) → None[source] Create the same permission on each service sharing the same resource.
-
delete_permission
(self: Permission, permission) → None[source] Delete the same permission on each service sharing the same resource.
-
cowbird.request_task
Celery base task that should be used to handle API requests. |
-
exception
cowbird.request_task.
AbortException
[source] Bases:
Exception
Exception raised when the chain must be interrupted.
Initialize self. See help(type(self)) for accurate signature.
-
class
cowbird.request_task.
RequestTask
[source] Bases:
celery.app.task.Task
,abc.ABC
Celery base task that should be used to handle API requests.
- Using this class will set the following Task configuration :
auto-retry for every RequestException
backoff and jitter strategy
There is also an abort_chain function to stop the chain of requests in case of an unrecoverable event
To use this class simply decorate your asynchronous function like this:
from celery import shared_task @shared_task(bind=True, base=RequestTask) def function_name(self, any, wanted, parameters): pass # function operations
Parameter
bind=True
will provide the self argument to the function which is the celery Task (not required).Parameter
base=RequestTask
will instantiate a RequestTask rather than a base celery Task as the self object.-
autoretry_for
:Tuple[Exception][source] Exceptions that are accepted as valid raising cases to attempt request retry.
-
retry_backoff
= True[source] Enable backoff strategy during request retry upon known raised exception.
-
retry_backoff_max
= 600[source] Maximum backoff delay permitted using request retry. Retries are abandoned if this delay is reached.
cowbird.utils
Utility |
|
A metaclass that creates a Singleton base class when called. |
|
Represents a null value to differentiate from None. |
|
Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when |
|
Applies the provided logging configuration settings to the logger. |
|
Logs the requested message to the logger and optionally enforce printing to the console according to configuration |
|
Logs the provided message to the logger and raises the corresponding exception afterwards. |
|
Converts |
|
Evaluate if argument is a callable |
|
|
|
Generates application configuration with all required utilities and settings configured. |
|
Loads configuration INI settings with additional handling. |
|
Retrieves the application |
|
Retrieves the ‘JSON’ body of a response using the property/callable according to the response’s implementation. |
|
Retrieves |
|
Converts a |
|
Retrieve application settings from a supported container. |
|
Obtains the |
|
|
|
Subscriber event that logs basic details about the incoming requests. |
|
Tween factory that logs any exception before re-raising it. |
|
|
|
|
|
-
cowbird.utils.
get_logger
(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is
logging.NOTSET
.
-
cowbird.utils.
set_logger_config
(logger: logging.Logger, force_stdout: bool = False, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger[source] Applies the provided logging configuration settings to the logger.
-
cowbird.utils.
print_log
(msg: str, logger: Optional[logging.Logger] = None, level: int = logging.INFO, **kwargs: Any) → None[source] Logs the requested message to the logger and optionally enforce printing to the console according to configuration value defined by
COWBIRD_LOG_PRINT
.
-
cowbird.utils.
raise_log
(msg: str, exception: Type[Exception] = Exception, logger: Optional[logging.Logger] = None, level: int = logging.ERROR) → NoReturn[source] Logs the provided message to the logger and raises the corresponding exception afterwards.
- Raises
exception – whichever exception provided is raised systematically after logging.
-
cowbird.utils.
bool2str
(value: Any) → str[source] Converts
value
to explicit"true"
or"false"
str
with permissive variants comparison that can represent common falsy or truthy values.
-
cowbird.utils.
islambda
(func: Any) → bool[source] Evaluate if argument is a callable
lambda
expression.
-
cowbird.utils.
get_app_config
(container: cowbird.typedefs.AnySettingsContainer) → pyramid.config.Configurator[source] Generates application configuration with all required utilities and settings configured.
-
cowbird.utils.
get_settings_from_config_ini
(config_ini_path, section=None)[source] Loads configuration INI settings with additional handling.
-
cowbird.utils.
get_registry
(container: cowbird.typedefs.AnyRegistryContainer, nothrow: bool = False) → Optional[pyramid.registry.Registry][source] Retrieves the application
registry
from various containers referencing to it.
-
cowbird.utils.
get_json
(response)[source] Retrieves the ‘JSON’ body of a response using the property/callable according to the response’s implementation.
-
cowbird.utils.
get_header
(header_name: str, header_container: cowbird.typedefs.AnyHeadersType, default: Optional[str] = None, split: Optional[Union[str, List[str]]] = None) → Optional[str][source] Retrieves
header_name
by fuzzy match (independently of upper/lower-case and underscore/dash) from various framework implementations ofHeaders
.If
split
is specified, the matchedheader_name
is first split with it and the first item is returned. This allows to parse complex headers (e.g.:text/plain; charset=UTF-8
totext/plain
withsplit=';'
).- Parameters
header_name – header to find.
header_container – where to look for header_name.
default – value to returned if header_container is invalid or header_name could not be found.
split – character(s) to use to split the found header_name.
-
cowbird.utils.
convert_response
(response: cowbird.typedefs.AnyResponseType) → pyramid.response.Response[source] Converts a
requests.Response
object to an equivalentpyramid.response.Response
object.Content of the
response
is expected to be JSON.- Parameters
response – response to be converted
- Returns
converted response
-
cowbird.utils.
get_settings
(container: Optional[cowbird.typedefs.AnySettingsContainer], app: bool = False) → cowbird.typedefs.SettingsType[source] Retrieve application settings from a supported container.
- Parameters
container – supported container with an handle to application settings.
app – allow retrieving from current thread registry if no container was defined.
- Returns
found application settings dictionary.
- Raises
TypeError – when no application settings could be found or unsupported container.
-
cowbird.utils.
fully_qualified_name
(obj: Union[Any, Type[Any]]) → str[source] Obtains the
'<module>.<name>'
full path definition of the object to allow finding and importing it.
-
cowbird.utils.
log_request
(event: pyramid.events.NewRequest) → None[source] Subscriber event that logs basic details about the incoming requests.
-
cowbird.utils.
log_exception_tween
(handler, registry)[source] Tween factory that logs any exception before re-raising it.
Application errors are marked as
ERROR
while non critical HTTP errors are marked asWARNING
.
-
class
cowbird.utils.
ExtendedEnum
[source] Bases:
enum.Enum
Utility
enum.Enum
methods.Create an extended enum with these utilities as follows:
class CustomEnum(ExtendedEnum): ItemA = "A" ItemB = "B"
-
classmethod
names
(cls) → List[str][source] Returns the member names assigned to corresponding enum elements.
-
classmethod
-
class
cowbird.utils.
SingletonMeta
[source] Bases:
type
A metaclass that creates a Singleton base class when called.
Create a class such that.
class A(object, metaclass=SingletonMeta): pass class B(object, metaclass=SingletonMeta): pass a1 = A() a2 = A() b1 = B() b2 = B() a1 is a2 # True b1 is b2 # True a1 is b1 # False
- 1
Created with sphinx-autoapi
Contributing
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. All contributors are presented in AUTHORS file.
You can contribute in many ways:
Types of Contributions
Report Bugs
Report bugs as a new issue.
If you are reporting a bug, please include:
Your operating system name and version.
Any details about your local setup that might be helpful in troubleshooting.
Detailed steps to reproduce the bug.
Write Documentation
Cowbird could always use more documentation, whether as part of the official Cowbird docs, in docstrings, or even on the web in blog posts, articles, and such.
Get Started!
Ready to contribute? Here’s how to set up cowbird for local development.
Clone the repository :
git clone https://github.com/Ouranosinc/cowbird
Install your local copy (see installation)
When you’re done making changes, check that your changes pass code formatting and tests:
make check
make test
Commit your changes and push your branch to GitHub.
Submit a pull request to the author (tests will run to evaluate that everything still works).
Pull Request Guidelines
Before you submit a pull request, check that it meets these guidelines:
The pull request should include tests.
If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in CHANGES (under relevant category of section Unreleased).
The tests should work for the specified version of Python for this project.
Tips
To run a subset of tests:
make SPEC="<CUSTOM TEST SPECIFICATIONS>" test-custom
With <CUSTOM TEST SPECIFICATIONS>
being any predefined markers, specific test classes or functions as supported
by pytest
runner.
Credits
Contributors
Francis Charette Migneault <francis.charette-migneault@crim.ca> [@fmigneault]
David Byrns <david.byrns@crim.ca> [@dbyrns]
Francis Pelletier <francis.pelletier@crim.ca> [@f-PLT]
Changes
Unreleased (latest)
Nothing yet.
0.4.1 (2022-03-09)
Features / Changes
Add an SSL verification setting.
Add Geoserver workspace and datastore creation/removal linked to user creation/removal.
Add automated publishing of shapefiles to Geoserver when new files are found.
Use
pip
legacy and faster resolver as per pypa/pip#9187 (comment) since current one is endlessly failing to resolve development packages (linting tools fromcheck
targets).
Bug Fixes
Pin
pymongo<4
to work with pinnedcelery
version.
0.4.0 (2021-08-05)
Features / Changes
Basic users’ workspaces management for new or removed users.
Add a Mongo database backend to store/restore monitoring state across sessions.
Bug Fixes
Celery has now a proper result backend.
Celery tasks are auto-discovered package-wide, no need to import them manually.
0.3.0 (2021-07-06)
Features / Changes
Add the RequestTask celery task for handling external services requests.
Add a docker image for the celery worker
Bug Fixes
n/a
0.2.0 (2021-05-12)
Features / Changes
Preliminary design which includes:
Webhook API
Services interface
Permissions synchronizer
File system monitoring
Bug Fixes
n/a
0.1.0 (2021-02-18)
Features / Changes
First structured release which includes:
CI/CD utilities
Minimal testing of utils
Documentation of generic details (WebApp, CLI, OpenAPI, configs, etc.)
Metadata of the package
Minimal
/services
API route with dummyService
Corresponding
cowbird services list
CLI command
Bug Fixes
n/a
Glossary
- Operation
Sequence of execution steps that configures or sends requests to other components of the bird-house stack in order to produce an end result where those components, that normally don’t interact directly together, will be able to obtain a combined and enhanced feature.
- Service
Managed component for which Cowbird provides some sort interactive Operation.