otupy.profiles.ctxd.data.endpoint.Endpoint
- class Endpoint(description=None, endpoint_type=None, transport=None, transfer=None, encoding=None, uri=None, provider=None)
Bases:
Record- Describes a network interface used to access remote functions. Its definition tries to capture all the
- different elements that are necessary to identify the communication facets of very different network
service architectures (e.g., REST, SOAP).
Note: since most of these fields are descriptive and intented to be used by external software, no specific data types are created from them.
Methods
Builds instance from dictionary
Converts to dictionary
validate_fieldsAttributes
This is a human-friendly description to understand the purpose and location of the service
Serialization or other form of data encoding to transfer high-level messages over the wire (e.g., json, xml, ...)
The architecture or standard followed by this endpoint definition (e.g., REST, SOAP, WSDL)
Owner of the web service
The communication protocol used to exchange messages with the endpoint
Transport protocol used to access the endpoint (may be None if a default/mandatory choice is implied by the transfer protocol)
The base URI used to contact the endpoint (it should include at least the IP address/hostname
- __init__(description=None, endpoint_type=None, transport=None, transfer=None, encoding=None, uri=None, provider=None)
- description: str = None
This is a human-friendly description to understand the purpose and location of the service
- encoding: str = None
Serialization or other form of data encoding to transfer high-level messages over the wire (e.g., json, xml, …)
- endpoint_type: str = None
The architecture or standard followed by this endpoint definition (e.g., REST, SOAP, WSDL)
- classmethod fromdict(dic, e)
Builds instance from dictionary
It is used during deserialization to create an otupy instance from the text message. It takes an
Encoderinstance that is used to recursively build instances of the inner objects (theEncoderprovides standard methods to create instances of base objects like strings, integers, boolean).- Parameters:
dic – The intermediary dictionary representation from which the object is built.
e – The
Encoderthat is being used.
- Returns:
An instance of this class initialized from the dictionary values.
- todict(e)
Converts to dictionary
It is used to convert this object to an intermediary representation during serialization. It takes an
Encoderargument that is used to recursively serialize inner data and structures (the Encoder provides standard methods for converting base types to dictionaries)..- Parameters:
e – The
Encoderthat is being used.- Returns:
A dictionary compliants to the Language Specification’s serialization rules.