id
int64 0
843k
| repository_name
stringlengths 7
55
| file_path
stringlengths 9
332
| class_name
stringlengths 3
290
| human_written_code
stringlengths 12
4.36M
| class_skeleton
stringlengths 19
2.2M
| total_program_units
int64 1
9.57k
| total_doc_str
int64 0
4.2k
| AvgCountLine
float64 0
7.89k
| AvgCountLineBlank
float64 0
300
| AvgCountLineCode
float64 0
7.89k
| AvgCountLineComment
float64 0
7.89k
| AvgCyclomatic
float64 0
130
| CommentToCodeRatio
float64 0
176
| CountClassBase
float64 0
48
| CountClassCoupled
float64 0
589
| CountClassCoupledModified
float64 0
581
| CountClassDerived
float64 0
5.37k
| CountDeclInstanceMethod
float64 0
4.2k
| CountDeclInstanceVariable
float64 0
299
| CountDeclMethod
float64 0
4.2k
| CountDeclMethodAll
float64 0
4.2k
| CountLine
float64 1
115k
| CountLineBlank
float64 0
9.01k
| CountLineCode
float64 0
94.4k
| CountLineCodeDecl
float64 0
46.1k
| CountLineCodeExe
float64 0
91.3k
| CountLineComment
float64 0
27k
| CountStmt
float64 1
93.2k
| CountStmtDecl
float64 0
46.1k
| CountStmtExe
float64 0
90.2k
| MaxCyclomatic
float64 0
759
| MaxInheritanceTree
float64 0
16
| MaxNesting
float64 0
34
| SumCyclomatic
float64 0
6k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,500 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_manifest_gte_lte_filter.py
|
mbed_cloud._backends.update_service.models.firmware_manifest_gte_lte_filter.FirmwareManifestGteLteFilter
|
class FirmwareManifestGteLteFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'etag': 'datetime',
'timestamp': 'datetime',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'etag': 'etag',
'timestamp': 'timestamp',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, etag=None, timestamp=None, updated_at=None):
"""
FirmwareManifestGteLteFilter - a model defined in Swagger
"""
self._created_at = created_at
self._etag = etag
self._timestamp = timestamp
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this FirmwareManifestGteLteFilter.
:return: The created_at of this FirmwareManifestGteLteFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this FirmwareManifestGteLteFilter.
:param created_at: The created_at of this FirmwareManifestGteLteFilter.
:type: datetime
"""
self._created_at = created_at
@property
def etag(self):
"""
Gets the etag of this FirmwareManifestGteLteFilter.
:return: The etag of this FirmwareManifestGteLteFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this FirmwareManifestGteLteFilter.
:param etag: The etag of this FirmwareManifestGteLteFilter.
:type: datetime
"""
self._etag = etag
@property
def timestamp(self):
"""
Gets the timestamp of this FirmwareManifestGteLteFilter.
:return: The timestamp of this FirmwareManifestGteLteFilter.
:rtype: datetime
"""
return self._timestamp
@timestamp.setter
def timestamp(self, timestamp):
"""
Sets the timestamp of this FirmwareManifestGteLteFilter.
:param timestamp: The timestamp of this FirmwareManifestGteLteFilter.
:type: datetime
"""
self._timestamp = timestamp
@property
def updated_at(self):
"""
Gets the updated_at of this FirmwareManifestGteLteFilter.
:return: The updated_at of this FirmwareManifestGteLteFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this FirmwareManifestGteLteFilter.
:param updated_at: The updated_at of this FirmwareManifestGteLteFilter.
:type: datetime
"""
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareManifestGteLteFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareManifestGteLteFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, etag=None, timestamp=None, updated_at=None):
'''
FirmwareManifestGteLteFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this FirmwareManifestGteLteFilter.
:return: The created_at of this FirmwareManifestGteLteFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this FirmwareManifestGteLteFilter.
:param created_at: The created_at of this FirmwareManifestGteLteFilter.
:type: datetime
'''
pass
@property
def etag(self):
'''
Gets the etag of this FirmwareManifestGteLteFilter.
:return: The etag of this FirmwareManifestGteLteFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this FirmwareManifestGteLteFilter.
:param etag: The etag of this FirmwareManifestGteLteFilter.
:type: datetime
'''
pass
@property
def timestamp(self):
'''
Gets the timestamp of this FirmwareManifestGteLteFilter.
:return: The timestamp of this FirmwareManifestGteLteFilter.
:rtype: datetime
'''
pass
@timestamp.setter
def timestamp(self):
'''
Sets the timestamp of this FirmwareManifestGteLteFilter.
:param timestamp: The timestamp of this FirmwareManifestGteLteFilter.
:type: datetime
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this FirmwareManifestGteLteFilter.
:return: The updated_at of this FirmwareManifestGteLteFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this FirmwareManifestGteLteFilter.
:param updated_at: The updated_at of this FirmwareManifestGteLteFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 23 | 15 | 9 | 1 | 4 | 4 | 1 | 0.95 | 1 | 3 | 0 | 0 | 14 | 5 | 14 | 14 | 175 | 33 | 73 | 33 | 50 | 69 | 45 | 25 | 30 | 5 | 1 | 2 | 19 |
2,501 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_manifest_eq_neq_filter.py
|
mbed_cloud._backends.update_service.models.firmware_manifest_eq_neq_filter.FirmwareManifestEqNeqFilter
|
class FirmwareManifestEqNeqFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'datafile': 'str',
'datafile_size': 'int',
'description': 'str',
'device_class': 'str',
'etag': 'datetime',
'id': 'str',
'name': 'str',
'timestamp': 'datetime',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'datafile': 'datafile',
'datafile_size': 'datafile_size',
'description': 'description',
'device_class': 'device_class',
'etag': 'etag',
'id': 'id',
'name': 'name',
'timestamp': 'timestamp',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, datafile=None, datafile_size=None, description=None, device_class=None, etag=None, id=None, name=None, timestamp=None, updated_at=None):
"""
FirmwareManifestEqNeqFilter - a model defined in Swagger
"""
self._created_at = created_at
self._datafile = datafile
self._datafile_size = datafile_size
self._description = description
self._device_class = device_class
self._etag = etag
self._id = id
self._name = name
self._timestamp = timestamp
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this FirmwareManifestEqNeqFilter.
:return: The created_at of this FirmwareManifestEqNeqFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this FirmwareManifestEqNeqFilter.
:param created_at: The created_at of this FirmwareManifestEqNeqFilter.
:type: datetime
"""
self._created_at = created_at
@property
def datafile(self):
"""
Gets the datafile of this FirmwareManifestEqNeqFilter.
:return: The datafile of this FirmwareManifestEqNeqFilter.
:rtype: str
"""
return self._datafile
@datafile.setter
def datafile(self, datafile):
"""
Sets the datafile of this FirmwareManifestEqNeqFilter.
:param datafile: The datafile of this FirmwareManifestEqNeqFilter.
:type: str
"""
self._datafile = datafile
@property
def datafile_size(self):
"""
Gets the datafile_size of this FirmwareManifestEqNeqFilter.
:return: The datafile_size of this FirmwareManifestEqNeqFilter.
:rtype: int
"""
return self._datafile_size
@datafile_size.setter
def datafile_size(self, datafile_size):
"""
Sets the datafile_size of this FirmwareManifestEqNeqFilter.
:param datafile_size: The datafile_size of this FirmwareManifestEqNeqFilter.
:type: int
"""
self._datafile_size = datafile_size
@property
def description(self):
"""
Gets the description of this FirmwareManifestEqNeqFilter.
:return: The description of this FirmwareManifestEqNeqFilter.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this FirmwareManifestEqNeqFilter.
:param description: The description of this FirmwareManifestEqNeqFilter.
:type: str
"""
self._description = description
@property
def device_class(self):
"""
Gets the device_class of this FirmwareManifestEqNeqFilter.
:return: The device_class of this FirmwareManifestEqNeqFilter.
:rtype: str
"""
return self._device_class
@device_class.setter
def device_class(self, device_class):
"""
Sets the device_class of this FirmwareManifestEqNeqFilter.
:param device_class: The device_class of this FirmwareManifestEqNeqFilter.
:type: str
"""
self._device_class = device_class
@property
def etag(self):
"""
Gets the etag of this FirmwareManifestEqNeqFilter.
:return: The etag of this FirmwareManifestEqNeqFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this FirmwareManifestEqNeqFilter.
:param etag: The etag of this FirmwareManifestEqNeqFilter.
:type: datetime
"""
self._etag = etag
@property
def id(self):
"""
Gets the id of this FirmwareManifestEqNeqFilter.
:return: The id of this FirmwareManifestEqNeqFilter.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this FirmwareManifestEqNeqFilter.
:param id: The id of this FirmwareManifestEqNeqFilter.
:type: str
"""
self._id = id
@property
def name(self):
"""
Gets the name of this FirmwareManifestEqNeqFilter.
:return: The name of this FirmwareManifestEqNeqFilter.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this FirmwareManifestEqNeqFilter.
:param name: The name of this FirmwareManifestEqNeqFilter.
:type: str
"""
self._name = name
@property
def timestamp(self):
"""
Gets the timestamp of this FirmwareManifestEqNeqFilter.
:return: The timestamp of this FirmwareManifestEqNeqFilter.
:rtype: datetime
"""
return self._timestamp
@timestamp.setter
def timestamp(self, timestamp):
"""
Sets the timestamp of this FirmwareManifestEqNeqFilter.
:param timestamp: The timestamp of this FirmwareManifestEqNeqFilter.
:type: datetime
"""
self._timestamp = timestamp
@property
def updated_at(self):
"""
Gets the updated_at of this FirmwareManifestEqNeqFilter.
:return: The updated_at of this FirmwareManifestEqNeqFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this FirmwareManifestEqNeqFilter.
:param updated_at: The updated_at of this FirmwareManifestEqNeqFilter.
:type: datetime
"""
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareManifestEqNeqFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareManifestEqNeqFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, datafile=None, datafile_size=None, description=None, device_class=None, etag=None, id=None, name=None, timestamp=None, updated_at=None):
'''
FirmwareManifestEqNeqFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this FirmwareManifestEqNeqFilter.
:return: The created_at of this FirmwareManifestEqNeqFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this FirmwareManifestEqNeqFilter.
:param created_at: The created_at of this FirmwareManifestEqNeqFilter.
:type: datetime
'''
pass
@property
def datafile(self):
'''
Gets the datafile of this FirmwareManifestEqNeqFilter.
:return: The datafile of this FirmwareManifestEqNeqFilter.
:rtype: str
'''
pass
@datafile.setter
def datafile(self):
'''
Sets the datafile of this FirmwareManifestEqNeqFilter.
:param datafile: The datafile of this FirmwareManifestEqNeqFilter.
:type: str
'''
pass
@property
def datafile_size(self):
'''
Gets the datafile_size of this FirmwareManifestEqNeqFilter.
:return: The datafile_size of this FirmwareManifestEqNeqFilter.
:rtype: int
'''
pass
@datafile_size.setter
def datafile_size(self):
'''
Sets the datafile_size of this FirmwareManifestEqNeqFilter.
:param datafile_size: The datafile_size of this FirmwareManifestEqNeqFilter.
:type: int
'''
pass
@property
def description(self):
'''
Gets the description of this FirmwareManifestEqNeqFilter.
:return: The description of this FirmwareManifestEqNeqFilter.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this FirmwareManifestEqNeqFilter.
:param description: The description of this FirmwareManifestEqNeqFilter.
:type: str
'''
pass
@property
def device_class(self):
'''
Gets the device_class of this FirmwareManifestEqNeqFilter.
:return: The device_class of this FirmwareManifestEqNeqFilter.
:rtype: str
'''
pass
@device_class.setter
def device_class(self):
'''
Sets the device_class of this FirmwareManifestEqNeqFilter.
:param device_class: The device_class of this FirmwareManifestEqNeqFilter.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this FirmwareManifestEqNeqFilter.
:return: The etag of this FirmwareManifestEqNeqFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this FirmwareManifestEqNeqFilter.
:param etag: The etag of this FirmwareManifestEqNeqFilter.
:type: datetime
'''
pass
@property
def id(self):
'''
Gets the id of this FirmwareManifestEqNeqFilter.
:return: The id of this FirmwareManifestEqNeqFilter.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this FirmwareManifestEqNeqFilter.
:param id: The id of this FirmwareManifestEqNeqFilter.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this FirmwareManifestEqNeqFilter.
:return: The name of this FirmwareManifestEqNeqFilter.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this FirmwareManifestEqNeqFilter.
:param name: The name of this FirmwareManifestEqNeqFilter.
:type: str
'''
pass
@property
def timestamp(self):
'''
Gets the timestamp of this FirmwareManifestEqNeqFilter.
:return: The timestamp of this FirmwareManifestEqNeqFilter.
:rtype: datetime
'''
pass
@timestamp.setter
def timestamp(self):
'''
Sets the timestamp of this FirmwareManifestEqNeqFilter.
:param timestamp: The timestamp of this FirmwareManifestEqNeqFilter.
:type: datetime
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this FirmwareManifestEqNeqFilter.
:return: The updated_at of this FirmwareManifestEqNeqFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this FirmwareManifestEqNeqFilter.
:param updated_at: The updated_at of this FirmwareManifestEqNeqFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 47 | 27 | 9 | 1 | 3 | 5 | 1 | 1.02 | 1 | 3 | 0 | 0 | 26 | 11 | 26 | 26 | 319 | 63 | 127 | 63 | 80 | 129 | 75 | 43 | 48 | 5 | 1 | 2 | 31 |
2,502 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_manifest.py
|
mbed_cloud._backends.update_service.models.firmware_manifest.FirmwareManifest
|
class FirmwareManifest(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'datafile': 'str',
'datafile_size': 'int',
'description': 'str',
'device_class': 'str',
'etag': 'datetime',
'id': 'str',
'key_table': 'str',
'name': 'str',
'object': 'str',
'timestamp': 'datetime',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'datafile': 'datafile',
'datafile_size': 'datafile_size',
'description': 'description',
'device_class': 'device_class',
'etag': 'etag',
'id': 'id',
'key_table': 'key_table',
'name': 'name',
'object': 'object',
'timestamp': 'timestamp',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, datafile=None, datafile_size=None, description=None, device_class=None, etag=None, id=None, key_table=None, name=None, object=None, timestamp=None, updated_at=None):
"""
FirmwareManifest - a model defined in Swagger
"""
self._created_at = created_at
self._datafile = datafile
self._datafile_size = datafile_size
self._description = description
self._device_class = device_class
self._etag = etag
self._id = id
self._key_table = key_table
self._name = name
self._object = object
self._timestamp = timestamp
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this FirmwareManifest.
The time the object was created
:return: The created_at of this FirmwareManifest.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this FirmwareManifest.
The time the object was created
:param created_at: The created_at of this FirmwareManifest.
:type: datetime
"""
if created_at is None:
raise ValueError("Invalid value for `created_at`, must not be `None`")
self._created_at = created_at
@property
def datafile(self):
"""
Gets the datafile of this FirmwareManifest.
The URL of the firmware manifest binary
:return: The datafile of this FirmwareManifest.
:rtype: str
"""
return self._datafile
@datafile.setter
def datafile(self, datafile):
"""
Sets the datafile of this FirmwareManifest.
The URL of the firmware manifest binary
:param datafile: The datafile of this FirmwareManifest.
:type: str
"""
if datafile is None:
raise ValueError("Invalid value for `datafile`, must not be `None`")
self._datafile = datafile
@property
def datafile_size(self):
"""
Gets the datafile_size of this FirmwareManifest.
The size of the datafile in bytes
:return: The datafile_size of this FirmwareManifest.
:rtype: int
"""
return self._datafile_size
@datafile_size.setter
def datafile_size(self, datafile_size):
"""
Sets the datafile_size of this FirmwareManifest.
The size of the datafile in bytes
:param datafile_size: The datafile_size of this FirmwareManifest.
:type: int
"""
self._datafile_size = datafile_size
@property
def description(self):
"""
Gets the description of this FirmwareManifest.
The description of the firmware manifest
:return: The description of this FirmwareManifest.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this FirmwareManifest.
The description of the firmware manifest
:param description: The description of this FirmwareManifest.
:type: str
"""
if description is None:
raise ValueError("Invalid value for `description`, must not be `None`")
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def device_class(self):
"""
Gets the device_class of this FirmwareManifest.
The class of the device
:return: The device_class of this FirmwareManifest.
:rtype: str
"""
return self._device_class
@device_class.setter
def device_class(self, device_class):
"""
Sets the device_class of this FirmwareManifest.
The class of the device
:param device_class: The device_class of this FirmwareManifest.
:type: str
"""
if device_class is None:
raise ValueError("Invalid value for `device_class`, must not be `None`")
self._device_class = device_class
@property
def etag(self):
"""
Gets the etag of this FirmwareManifest.
The entity instance signature
:return: The etag of this FirmwareManifest.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this FirmwareManifest.
The entity instance signature
:param etag: The etag of this FirmwareManifest.
:type: datetime
"""
if etag is None:
raise ValueError("Invalid value for `etag`, must not be `None`")
self._etag = etag
@property
def id(self):
"""
Gets the id of this FirmwareManifest.
The firmware manifest ID
:return: The id of this FirmwareManifest.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this FirmwareManifest.
The firmware manifest ID
:param id: The id of this FirmwareManifest.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def key_table(self):
"""
Gets the key_table of this FirmwareManifest.
The key table of pre-shared keys for devices
:return: The key_table of this FirmwareManifest.
:rtype: str
"""
return self._key_table
@key_table.setter
def key_table(self, key_table):
"""
Sets the key_table of this FirmwareManifest.
The key table of pre-shared keys for devices
:param key_table: The key_table of this FirmwareManifest.
:type: str
"""
self._key_table = key_table
@property
def name(self):
"""
Gets the name of this FirmwareManifest.
The name of the object
:return: The name of this FirmwareManifest.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this FirmwareManifest.
The name of the object
:param name: The name of this FirmwareManifest.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
@property
def object(self):
"""
Gets the object of this FirmwareManifest.
The API resource entity
:return: The object of this FirmwareManifest.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this FirmwareManifest.
The API resource entity
:param object: The object of this FirmwareManifest.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
self._object = object
@property
def timestamp(self):
"""
Gets the timestamp of this FirmwareManifest.
The firmware manifest version as a timestamp
:return: The timestamp of this FirmwareManifest.
:rtype: datetime
"""
return self._timestamp
@timestamp.setter
def timestamp(self, timestamp):
"""
Sets the timestamp of this FirmwareManifest.
The firmware manifest version as a timestamp
:param timestamp: The timestamp of this FirmwareManifest.
:type: datetime
"""
if timestamp is None:
raise ValueError("Invalid value for `timestamp`, must not be `None`")
self._timestamp = timestamp
@property
def updated_at(self):
"""
Gets the updated_at of this FirmwareManifest.
The time the object was updated
:return: The updated_at of this FirmwareManifest.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this FirmwareManifest.
The time the object was updated
:param updated_at: The updated_at of this FirmwareManifest.
:type: datetime
"""
if updated_at is None:
raise ValueError("Invalid value for `updated_at`, must not be `None`")
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareManifest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareManifest(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, datafile=None, datafile_size=None, description=None, device_class=None, etag=None, id=None, key_table=None, name=None, object=None, timestamp=None, updated_at=None):
'''
FirmwareManifest - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this FirmwareManifest.
The time the object was created
:return: The created_at of this FirmwareManifest.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this FirmwareManifest.
The time the object was created
:param created_at: The created_at of this FirmwareManifest.
:type: datetime
'''
pass
@property
def datafile(self):
'''
Gets the datafile of this FirmwareManifest.
The URL of the firmware manifest binary
:return: The datafile of this FirmwareManifest.
:rtype: str
'''
pass
@datafile.setter
def datafile(self):
'''
Sets the datafile of this FirmwareManifest.
The URL of the firmware manifest binary
:param datafile: The datafile of this FirmwareManifest.
:type: str
'''
pass
@property
def datafile_size(self):
'''
Gets the datafile_size of this FirmwareManifest.
The size of the datafile in bytes
:return: The datafile_size of this FirmwareManifest.
:rtype: int
'''
pass
@datafile_size.setter
def datafile_size(self):
'''
Sets the datafile_size of this FirmwareManifest.
The size of the datafile in bytes
:param datafile_size: The datafile_size of this FirmwareManifest.
:type: int
'''
pass
@property
def description(self):
'''
Gets the description of this FirmwareManifest.
The description of the firmware manifest
:return: The description of this FirmwareManifest.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this FirmwareManifest.
The description of the firmware manifest
:param description: The description of this FirmwareManifest.
:type: str
'''
pass
@property
def device_class(self):
'''
Gets the device_class of this FirmwareManifest.
The class of the device
:return: The device_class of this FirmwareManifest.
:rtype: str
'''
pass
@device_class.setter
def device_class(self):
'''
Sets the device_class of this FirmwareManifest.
The class of the device
:param device_class: The device_class of this FirmwareManifest.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this FirmwareManifest.
The entity instance signature
:return: The etag of this FirmwareManifest.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this FirmwareManifest.
The entity instance signature
:param etag: The etag of this FirmwareManifest.
:type: datetime
'''
pass
@property
def id(self):
'''
Gets the id of this FirmwareManifest.
The firmware manifest ID
:return: The id of this FirmwareManifest.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this FirmwareManifest.
The firmware manifest ID
:param id: The id of this FirmwareManifest.
:type: str
'''
pass
@property
def key_table(self):
'''
Gets the key_table of this FirmwareManifest.
The key table of pre-shared keys for devices
:return: The key_table of this FirmwareManifest.
:rtype: str
'''
pass
@key_table.setter
def key_table(self):
'''
Sets the key_table of this FirmwareManifest.
The key table of pre-shared keys for devices
:param key_table: The key_table of this FirmwareManifest.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this FirmwareManifest.
The name of the object
:return: The name of this FirmwareManifest.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this FirmwareManifest.
The name of the object
:param name: The name of this FirmwareManifest.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this FirmwareManifest.
The API resource entity
:return: The object of this FirmwareManifest.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this FirmwareManifest.
The API resource entity
:param object: The object of this FirmwareManifest.
:type: str
'''
pass
@property
def timestamp(self):
'''
Gets the timestamp of this FirmwareManifest.
The firmware manifest version as a timestamp
:return: The timestamp of this FirmwareManifest.
:rtype: datetime
'''
pass
@timestamp.setter
def timestamp(self):
'''
Sets the timestamp of this FirmwareManifest.
The firmware manifest version as a timestamp
:param timestamp: The timestamp of this FirmwareManifest.
:type: datetime
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this FirmwareManifest.
The time the object was updated
:return: The updated_at of this FirmwareManifest.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this FirmwareManifest.
The time the object was updated
:param updated_at: The updated_at of this FirmwareManifest.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 55 | 31 | 11 | 1 | 4 | 5 | 2 | 1.02 | 1 | 4 | 0 | 0 | 30 | 13 | 30 | 30 | 415 | 73 | 169 | 73 | 114 | 173 | 109 | 49 | 78 | 5 | 1 | 2 | 47 |
2,503 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_image_page.py
|
mbed_cloud._backends.update_service.models.firmware_image_page.FirmwareImagePage
|
class FirmwareImagePage(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[FirmwareImage]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
FirmwareImagePage - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this FirmwareImagePage.
:return: The after of this FirmwareImagePage.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this FirmwareImagePage.
:param after: The after of this FirmwareImagePage.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this FirmwareImagePage.
:return: The data of this FirmwareImagePage.
:rtype: list[FirmwareImage]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this FirmwareImagePage.
:param data: The data of this FirmwareImagePage.
:type: list[FirmwareImage]
"""
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this FirmwareImagePage.
:return: The has_more of this FirmwareImagePage.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this FirmwareImagePage.
:param has_more: The has_more of this FirmwareImagePage.
:type: bool
"""
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this FirmwareImagePage.
:return: The limit of this FirmwareImagePage.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this FirmwareImagePage.
:param limit: The limit of this FirmwareImagePage.
:type: int
"""
self._limit = limit
@property
def object(self):
"""
Gets the object of this FirmwareImagePage.
:return: The object of this FirmwareImagePage.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this FirmwareImagePage.
:param object: The object of this FirmwareImagePage.
:type: str
"""
self._object = object
@property
def order(self):
"""
Gets the order of this FirmwareImagePage.
The order of the records based on creation time, `ASC` or `DESC`; by default `ASC`.
:return: The order of this FirmwareImagePage.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this FirmwareImagePage.
The order of the records based on creation time, `ASC` or `DESC`; by default `ASC`.
:param order: The order of this FirmwareImagePage.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this FirmwareImagePage.
:return: The total_count of this FirmwareImagePage.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this FirmwareImagePage.
:param total_count: The total_count of this FirmwareImagePage.
:type: int
"""
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareImagePage):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareImagePage(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
FirmwareImagePage - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this FirmwareImagePage.
:return: The after of this FirmwareImagePage.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this FirmwareImagePage.
:param after: The after of this FirmwareImagePage.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this FirmwareImagePage.
:return: The data of this FirmwareImagePage.
:rtype: list[FirmwareImage]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this FirmwareImagePage.
:param data: The data of this FirmwareImagePage.
:type: list[FirmwareImage]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this FirmwareImagePage.
:return: The has_more of this FirmwareImagePage.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this FirmwareImagePage.
:param has_more: The has_more of this FirmwareImagePage.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this FirmwareImagePage.
:return: The limit of this FirmwareImagePage.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this FirmwareImagePage.
:param limit: The limit of this FirmwareImagePage.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this FirmwareImagePage.
:return: The object of this FirmwareImagePage.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this FirmwareImagePage.
:param object: The object of this FirmwareImagePage.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this FirmwareImagePage.
The order of the records based on creation time, `ASC` or `DESC`; by default `ASC`.
:return: The order of this FirmwareImagePage.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this FirmwareImagePage.
The order of the records based on creation time, `ASC` or `DESC`; by default `ASC`.
:param order: The order of this FirmwareImagePage.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this FirmwareImagePage.
:return: The total_count of this FirmwareImagePage.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this FirmwareImagePage.
:param total_count: The total_count of this FirmwareImagePage.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 9 | 1 | 4 | 5 | 1 | 0.95 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 255 | 48 | 106 | 49 | 71 | 101 | 63 | 35 | 42 | 5 | 1 | 2 | 26 |
2,504 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_image_in_nin_filter.py
|
mbed_cloud._backends.update_service.models.firmware_image_in_nin_filter.FirmwareImageInNinFilter
|
class FirmwareImageInNinFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'datafile': 'str',
'datafile_checksum': 'str',
'datafile_size': 'int',
'description': 'str',
'etag': 'datetime',
'id': 'str',
'name': 'str',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'datafile': 'datafile',
'datafile_checksum': 'datafile_checksum',
'datafile_size': 'datafile_size',
'description': 'description',
'etag': 'etag',
'id': 'id',
'name': 'name',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, datafile=None, datafile_checksum=None, datafile_size=None, description=None, etag=None, id=None, name=None, updated_at=None):
"""
FirmwareImageInNinFilter - a model defined in Swagger
"""
self._created_at = created_at
self._datafile = datafile
self._datafile_checksum = datafile_checksum
self._datafile_size = datafile_size
self._description = description
self._etag = etag
self._id = id
self._name = name
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this FirmwareImageInNinFilter.
:return: The created_at of this FirmwareImageInNinFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this FirmwareImageInNinFilter.
:param created_at: The created_at of this FirmwareImageInNinFilter.
:type: datetime
"""
self._created_at = created_at
@property
def datafile(self):
"""
Gets the datafile of this FirmwareImageInNinFilter.
:return: The datafile of this FirmwareImageInNinFilter.
:rtype: str
"""
return self._datafile
@datafile.setter
def datafile(self, datafile):
"""
Sets the datafile of this FirmwareImageInNinFilter.
:param datafile: The datafile of this FirmwareImageInNinFilter.
:type: str
"""
self._datafile = datafile
@property
def datafile_checksum(self):
"""
Gets the datafile_checksum of this FirmwareImageInNinFilter.
:return: The datafile_checksum of this FirmwareImageInNinFilter.
:rtype: str
"""
return self._datafile_checksum
@datafile_checksum.setter
def datafile_checksum(self, datafile_checksum):
"""
Sets the datafile_checksum of this FirmwareImageInNinFilter.
:param datafile_checksum: The datafile_checksum of this FirmwareImageInNinFilter.
:type: str
"""
self._datafile_checksum = datafile_checksum
@property
def datafile_size(self):
"""
Gets the datafile_size of this FirmwareImageInNinFilter.
:return: The datafile_size of this FirmwareImageInNinFilter.
:rtype: int
"""
return self._datafile_size
@datafile_size.setter
def datafile_size(self, datafile_size):
"""
Sets the datafile_size of this FirmwareImageInNinFilter.
:param datafile_size: The datafile_size of this FirmwareImageInNinFilter.
:type: int
"""
self._datafile_size = datafile_size
@property
def description(self):
"""
Gets the description of this FirmwareImageInNinFilter.
:return: The description of this FirmwareImageInNinFilter.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this FirmwareImageInNinFilter.
:param description: The description of this FirmwareImageInNinFilter.
:type: str
"""
self._description = description
@property
def etag(self):
"""
Gets the etag of this FirmwareImageInNinFilter.
:return: The etag of this FirmwareImageInNinFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this FirmwareImageInNinFilter.
:param etag: The etag of this FirmwareImageInNinFilter.
:type: datetime
"""
self._etag = etag
@property
def id(self):
"""
Gets the id of this FirmwareImageInNinFilter.
:return: The id of this FirmwareImageInNinFilter.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this FirmwareImageInNinFilter.
:param id: The id of this FirmwareImageInNinFilter.
:type: str
"""
self._id = id
@property
def name(self):
"""
Gets the name of this FirmwareImageInNinFilter.
:return: The name of this FirmwareImageInNinFilter.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this FirmwareImageInNinFilter.
:param name: The name of this FirmwareImageInNinFilter.
:type: str
"""
self._name = name
@property
def updated_at(self):
"""
Gets the updated_at of this FirmwareImageInNinFilter.
:return: The updated_at of this FirmwareImageInNinFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this FirmwareImageInNinFilter.
:param updated_at: The updated_at of this FirmwareImageInNinFilter.
:type: datetime
"""
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareImageInNinFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareImageInNinFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, datafile=None, datafile_checksum=None, datafile_size=None, description=None, etag=None, id=None, name=None, updated_at=None):
'''
FirmwareImageInNinFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this FirmwareImageInNinFilter.
:return: The created_at of this FirmwareImageInNinFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this FirmwareImageInNinFilter.
:param created_at: The created_at of this FirmwareImageInNinFilter.
:type: datetime
'''
pass
@property
def datafile(self):
'''
Gets the datafile of this FirmwareImageInNinFilter.
:return: The datafile of this FirmwareImageInNinFilter.
:rtype: str
'''
pass
@datafile.setter
def datafile(self):
'''
Sets the datafile of this FirmwareImageInNinFilter.
:param datafile: The datafile of this FirmwareImageInNinFilter.
:type: str
'''
pass
@property
def datafile_checksum(self):
'''
Gets the datafile_checksum of this FirmwareImageInNinFilter.
:return: The datafile_checksum of this FirmwareImageInNinFilter.
:rtype: str
'''
pass
@datafile_checksum.setter
def datafile_checksum(self):
'''
Sets the datafile_checksum of this FirmwareImageInNinFilter.
:param datafile_checksum: The datafile_checksum of this FirmwareImageInNinFilter.
:type: str
'''
pass
@property
def datafile_size(self):
'''
Gets the datafile_size of this FirmwareImageInNinFilter.
:return: The datafile_size of this FirmwareImageInNinFilter.
:rtype: int
'''
pass
@datafile_size.setter
def datafile_size(self):
'''
Sets the datafile_size of this FirmwareImageInNinFilter.
:param datafile_size: The datafile_size of this FirmwareImageInNinFilter.
:type: int
'''
pass
@property
def description(self):
'''
Gets the description of this FirmwareImageInNinFilter.
:return: The description of this FirmwareImageInNinFilter.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this FirmwareImageInNinFilter.
:param description: The description of this FirmwareImageInNinFilter.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this FirmwareImageInNinFilter.
:return: The etag of this FirmwareImageInNinFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this FirmwareImageInNinFilter.
:param etag: The etag of this FirmwareImageInNinFilter.
:type: datetime
'''
pass
@property
def id(self):
'''
Gets the id of this FirmwareImageInNinFilter.
:return: The id of this FirmwareImageInNinFilter.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this FirmwareImageInNinFilter.
:param id: The id of this FirmwareImageInNinFilter.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this FirmwareImageInNinFilter.
:return: The name of this FirmwareImageInNinFilter.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this FirmwareImageInNinFilter.
:param name: The name of this FirmwareImageInNinFilter.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this FirmwareImageInNinFilter.
:return: The updated_at of this FirmwareImageInNinFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this FirmwareImageInNinFilter.
:param updated_at: The updated_at of this FirmwareImageInNinFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 43 | 25 | 9 | 1 | 3 | 5 | 1 | 1.01 | 1 | 3 | 0 | 0 | 24 | 10 | 24 | 24 | 295 | 58 | 118 | 58 | 75 | 119 | 70 | 40 | 45 | 5 | 1 | 2 | 29 |
2,505 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_image_gte_lte_filter.py
|
mbed_cloud._backends.update_service.models.firmware_image_gte_lte_filter.FirmwareImageGteLteFilter
|
class FirmwareImageGteLteFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'etag': 'datetime',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'etag': 'etag',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, etag=None, updated_at=None):
"""
FirmwareImageGteLteFilter - a model defined in Swagger
"""
self._created_at = created_at
self._etag = etag
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this FirmwareImageGteLteFilter.
:return: The created_at of this FirmwareImageGteLteFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this FirmwareImageGteLteFilter.
:param created_at: The created_at of this FirmwareImageGteLteFilter.
:type: datetime
"""
self._created_at = created_at
@property
def etag(self):
"""
Gets the etag of this FirmwareImageGteLteFilter.
:return: The etag of this FirmwareImageGteLteFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this FirmwareImageGteLteFilter.
:param etag: The etag of this FirmwareImageGteLteFilter.
:type: datetime
"""
self._etag = etag
@property
def updated_at(self):
"""
Gets the updated_at of this FirmwareImageGteLteFilter.
:return: The updated_at of this FirmwareImageGteLteFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this FirmwareImageGteLteFilter.
:param updated_at: The updated_at of this FirmwareImageGteLteFilter.
:type: datetime
"""
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareImageGteLteFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareImageGteLteFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, etag=None, updated_at=None):
'''
FirmwareImageGteLteFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this FirmwareImageGteLteFilter.
:return: The created_at of this FirmwareImageGteLteFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this FirmwareImageGteLteFilter.
:param created_at: The created_at of this FirmwareImageGteLteFilter.
:type: datetime
'''
pass
@property
def etag(self):
'''
Gets the etag of this FirmwareImageGteLteFilter.
:return: The etag of this FirmwareImageGteLteFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this FirmwareImageGteLteFilter.
:param etag: The etag of this FirmwareImageGteLteFilter.
:type: datetime
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this FirmwareImageGteLteFilter.
:return: The updated_at of this FirmwareImageGteLteFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this FirmwareImageGteLteFilter.
:param updated_at: The updated_at of this FirmwareImageGteLteFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 19 | 13 | 9 | 1 | 4 | 4 | 1 | 0.92 | 1 | 3 | 0 | 0 | 12 | 4 | 12 | 12 | 151 | 28 | 64 | 28 | 45 | 59 | 40 | 22 | 27 | 5 | 1 | 2 | 17 |
2,506 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_image_eq_neq_filter.py
|
mbed_cloud._backends.update_service.models.firmware_image_eq_neq_filter.FirmwareImageEqNeqFilter
|
class FirmwareImageEqNeqFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'datafile': 'str',
'datafile_checksum': 'str',
'datafile_size': 'int',
'description': 'str',
'etag': 'datetime',
'id': 'str',
'name': 'str',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'datafile': 'datafile',
'datafile_checksum': 'datafile_checksum',
'datafile_size': 'datafile_size',
'description': 'description',
'etag': 'etag',
'id': 'id',
'name': 'name',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, datafile=None, datafile_checksum=None, datafile_size=None, description=None, etag=None, id=None, name=None, updated_at=None):
"""
FirmwareImageEqNeqFilter - a model defined in Swagger
"""
self._created_at = created_at
self._datafile = datafile
self._datafile_checksum = datafile_checksum
self._datafile_size = datafile_size
self._description = description
self._etag = etag
self._id = id
self._name = name
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this FirmwareImageEqNeqFilter.
:return: The created_at of this FirmwareImageEqNeqFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this FirmwareImageEqNeqFilter.
:param created_at: The created_at of this FirmwareImageEqNeqFilter.
:type: datetime
"""
self._created_at = created_at
@property
def datafile(self):
"""
Gets the datafile of this FirmwareImageEqNeqFilter.
:return: The datafile of this FirmwareImageEqNeqFilter.
:rtype: str
"""
return self._datafile
@datafile.setter
def datafile(self, datafile):
"""
Sets the datafile of this FirmwareImageEqNeqFilter.
:param datafile: The datafile of this FirmwareImageEqNeqFilter.
:type: str
"""
self._datafile = datafile
@property
def datafile_checksum(self):
"""
Gets the datafile_checksum of this FirmwareImageEqNeqFilter.
:return: The datafile_checksum of this FirmwareImageEqNeqFilter.
:rtype: str
"""
return self._datafile_checksum
@datafile_checksum.setter
def datafile_checksum(self, datafile_checksum):
"""
Sets the datafile_checksum of this FirmwareImageEqNeqFilter.
:param datafile_checksum: The datafile_checksum of this FirmwareImageEqNeqFilter.
:type: str
"""
self._datafile_checksum = datafile_checksum
@property
def datafile_size(self):
"""
Gets the datafile_size of this FirmwareImageEqNeqFilter.
:return: The datafile_size of this FirmwareImageEqNeqFilter.
:rtype: int
"""
return self._datafile_size
@datafile_size.setter
def datafile_size(self, datafile_size):
"""
Sets the datafile_size of this FirmwareImageEqNeqFilter.
:param datafile_size: The datafile_size of this FirmwareImageEqNeqFilter.
:type: int
"""
self._datafile_size = datafile_size
@property
def description(self):
"""
Gets the description of this FirmwareImageEqNeqFilter.
:return: The description of this FirmwareImageEqNeqFilter.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this FirmwareImageEqNeqFilter.
:param description: The description of this FirmwareImageEqNeqFilter.
:type: str
"""
self._description = description
@property
def etag(self):
"""
Gets the etag of this FirmwareImageEqNeqFilter.
:return: The etag of this FirmwareImageEqNeqFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this FirmwareImageEqNeqFilter.
:param etag: The etag of this FirmwareImageEqNeqFilter.
:type: datetime
"""
self._etag = etag
@property
def id(self):
"""
Gets the id of this FirmwareImageEqNeqFilter.
:return: The id of this FirmwareImageEqNeqFilter.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this FirmwareImageEqNeqFilter.
:param id: The id of this FirmwareImageEqNeqFilter.
:type: str
"""
self._id = id
@property
def name(self):
"""
Gets the name of this FirmwareImageEqNeqFilter.
:return: The name of this FirmwareImageEqNeqFilter.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this FirmwareImageEqNeqFilter.
:param name: The name of this FirmwareImageEqNeqFilter.
:type: str
"""
self._name = name
@property
def updated_at(self):
"""
Gets the updated_at of this FirmwareImageEqNeqFilter.
:return: The updated_at of this FirmwareImageEqNeqFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this FirmwareImageEqNeqFilter.
:param updated_at: The updated_at of this FirmwareImageEqNeqFilter.
:type: datetime
"""
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareImageEqNeqFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareImageEqNeqFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, datafile=None, datafile_checksum=None, datafile_size=None, description=None, etag=None, id=None, name=None, updated_at=None):
'''
FirmwareImageEqNeqFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this FirmwareImageEqNeqFilter.
:return: The created_at of this FirmwareImageEqNeqFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this FirmwareImageEqNeqFilter.
:param created_at: The created_at of this FirmwareImageEqNeqFilter.
:type: datetime
'''
pass
@property
def datafile(self):
'''
Gets the datafile of this FirmwareImageEqNeqFilter.
:return: The datafile of this FirmwareImageEqNeqFilter.
:rtype: str
'''
pass
@datafile.setter
def datafile(self):
'''
Sets the datafile of this FirmwareImageEqNeqFilter.
:param datafile: The datafile of this FirmwareImageEqNeqFilter.
:type: str
'''
pass
@property
def datafile_checksum(self):
'''
Gets the datafile_checksum of this FirmwareImageEqNeqFilter.
:return: The datafile_checksum of this FirmwareImageEqNeqFilter.
:rtype: str
'''
pass
@datafile_checksum.setter
def datafile_checksum(self):
'''
Sets the datafile_checksum of this FirmwareImageEqNeqFilter.
:param datafile_checksum: The datafile_checksum of this FirmwareImageEqNeqFilter.
:type: str
'''
pass
@property
def datafile_size(self):
'''
Gets the datafile_size of this FirmwareImageEqNeqFilter.
:return: The datafile_size of this FirmwareImageEqNeqFilter.
:rtype: int
'''
pass
@datafile_size.setter
def datafile_size(self):
'''
Sets the datafile_size of this FirmwareImageEqNeqFilter.
:param datafile_size: The datafile_size of this FirmwareImageEqNeqFilter.
:type: int
'''
pass
@property
def description(self):
'''
Gets the description of this FirmwareImageEqNeqFilter.
:return: The description of this FirmwareImageEqNeqFilter.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this FirmwareImageEqNeqFilter.
:param description: The description of this FirmwareImageEqNeqFilter.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this FirmwareImageEqNeqFilter.
:return: The etag of this FirmwareImageEqNeqFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this FirmwareImageEqNeqFilter.
:param etag: The etag of this FirmwareImageEqNeqFilter.
:type: datetime
'''
pass
@property
def id(self):
'''
Gets the id of this FirmwareImageEqNeqFilter.
:return: The id of this FirmwareImageEqNeqFilter.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this FirmwareImageEqNeqFilter.
:param id: The id of this FirmwareImageEqNeqFilter.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this FirmwareImageEqNeqFilter.
:return: The name of this FirmwareImageEqNeqFilter.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this FirmwareImageEqNeqFilter.
:param name: The name of this FirmwareImageEqNeqFilter.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this FirmwareImageEqNeqFilter.
:return: The updated_at of this FirmwareImageEqNeqFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this FirmwareImageEqNeqFilter.
:param updated_at: The updated_at of this FirmwareImageEqNeqFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 43 | 25 | 9 | 1 | 3 | 5 | 1 | 1.01 | 1 | 3 | 0 | 0 | 24 | 10 | 24 | 24 | 295 | 58 | 118 | 58 | 75 | 119 | 70 | 40 | 45 | 5 | 1 | 2 | 29 |
2,507 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/firmware_image.py
|
mbed_cloud._backends.update_service.models.firmware_image.FirmwareImage
|
class FirmwareImage(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'datafile': 'str',
'datafile_checksum': 'str',
'datafile_size': 'int',
'description': 'str',
'etag': 'datetime',
'id': 'str',
'name': 'str',
'object': 'str',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'datafile': 'datafile',
'datafile_checksum': 'datafile_checksum',
'datafile_size': 'datafile_size',
'description': 'description',
'etag': 'etag',
'id': 'id',
'name': 'name',
'object': 'object',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, datafile=None, datafile_checksum=None, datafile_size=None, description=None, etag=None, id=None, name=None, object=None, updated_at=None):
"""
FirmwareImage - a model defined in Swagger
"""
self._created_at = created_at
self._datafile = datafile
self._datafile_checksum = datafile_checksum
self._datafile_size = datafile_size
self._description = description
self._etag = etag
self._id = id
self._name = name
self._object = object
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this FirmwareImage.
The time the object was created
:return: The created_at of this FirmwareImage.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this FirmwareImage.
The time the object was created
:param created_at: The created_at of this FirmwareImage.
:type: datetime
"""
if created_at is None:
raise ValueError("Invalid value for `created_at`, must not be `None`")
self._created_at = created_at
@property
def datafile(self):
"""
Gets the datafile of this FirmwareImage.
The firmware image file URL
:return: The datafile of this FirmwareImage.
:rtype: str
"""
return self._datafile
@datafile.setter
def datafile(self, datafile):
"""
Sets the datafile of this FirmwareImage.
The firmware image file URL
:param datafile: The datafile of this FirmwareImage.
:type: str
"""
if datafile is None:
raise ValueError("Invalid value for `datafile`, must not be `None`")
self._datafile = datafile
@property
def datafile_checksum(self):
"""
Gets the datafile_checksum of this FirmwareImage.
The checksum (sha256) generated for the datafile
:return: The datafile_checksum of this FirmwareImage.
:rtype: str
"""
return self._datafile_checksum
@datafile_checksum.setter
def datafile_checksum(self, datafile_checksum):
"""
Sets the datafile_checksum of this FirmwareImage.
The checksum (sha256) generated for the datafile
:param datafile_checksum: The datafile_checksum of this FirmwareImage.
:type: str
"""
if datafile_checksum is None:
raise ValueError("Invalid value for `datafile_checksum`, must not be `None`")
self._datafile_checksum = datafile_checksum
@property
def datafile_size(self):
"""
Gets the datafile_size of this FirmwareImage.
The size of the datafile in bytes
:return: The datafile_size of this FirmwareImage.
:rtype: int
"""
return self._datafile_size
@datafile_size.setter
def datafile_size(self, datafile_size):
"""
Sets the datafile_size of this FirmwareImage.
The size of the datafile in bytes
:param datafile_size: The datafile_size of this FirmwareImage.
:type: int
"""
self._datafile_size = datafile_size
@property
def description(self):
"""
Gets the description of this FirmwareImage.
The description of the object
:return: The description of this FirmwareImage.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this FirmwareImage.
The description of the object
:param description: The description of this FirmwareImage.
:type: str
"""
if description is None:
raise ValueError("Invalid value for `description`, must not be `None`")
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def etag(self):
"""
Gets the etag of this FirmwareImage.
The entity instance signature
:return: The etag of this FirmwareImage.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this FirmwareImage.
The entity instance signature
:param etag: The etag of this FirmwareImage.
:type: datetime
"""
if etag is None:
raise ValueError("Invalid value for `etag`, must not be `None`")
self._etag = etag
@property
def id(self):
"""
Gets the id of this FirmwareImage.
The firmware image ID
:return: The id of this FirmwareImage.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this FirmwareImage.
The firmware image ID
:param id: The id of this FirmwareImage.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def name(self):
"""
Gets the name of this FirmwareImage.
The firmware image name
:return: The name of this FirmwareImage.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this FirmwareImage.
The firmware image name
:param name: The name of this FirmwareImage.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
@property
def object(self):
"""
Gets the object of this FirmwareImage.
The API resource entity
:return: The object of this FirmwareImage.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this FirmwareImage.
The API resource entity
:param object: The object of this FirmwareImage.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
self._object = object
@property
def updated_at(self):
"""
Gets the updated_at of this FirmwareImage.
The time the object was updated
:return: The updated_at of this FirmwareImage.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this FirmwareImage.
The time the object was updated
:param updated_at: The updated_at of this FirmwareImage.
:type: datetime
"""
if updated_at is None:
raise ValueError("Invalid value for `updated_at`, must not be `None`")
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FirmwareImage):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class FirmwareImage(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, datafile=None, datafile_checksum=None, datafile_size=None, description=None, etag=None, id=None, name=None, object=None, updated_at=None):
'''
FirmwareImage - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this FirmwareImage.
The time the object was created
:return: The created_at of this FirmwareImage.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this FirmwareImage.
The time the object was created
:param created_at: The created_at of this FirmwareImage.
:type: datetime
'''
pass
@property
def datafile(self):
'''
Gets the datafile of this FirmwareImage.
The firmware image file URL
:return: The datafile of this FirmwareImage.
:rtype: str
'''
pass
@datafile.setter
def datafile(self):
'''
Sets the datafile of this FirmwareImage.
The firmware image file URL
:param datafile: The datafile of this FirmwareImage.
:type: str
'''
pass
@property
def datafile_checksum(self):
'''
Gets the datafile_checksum of this FirmwareImage.
The checksum (sha256) generated for the datafile
:return: The datafile_checksum of this FirmwareImage.
:rtype: str
'''
pass
@datafile_checksum.setter
def datafile_checksum(self):
'''
Sets the datafile_checksum of this FirmwareImage.
The checksum (sha256) generated for the datafile
:param datafile_checksum: The datafile_checksum of this FirmwareImage.
:type: str
'''
pass
@property
def datafile_size(self):
'''
Gets the datafile_size of this FirmwareImage.
The size of the datafile in bytes
:return: The datafile_size of this FirmwareImage.
:rtype: int
'''
pass
@datafile_size.setter
def datafile_size(self):
'''
Sets the datafile_size of this FirmwareImage.
The size of the datafile in bytes
:param datafile_size: The datafile_size of this FirmwareImage.
:type: int
'''
pass
@property
def description(self):
'''
Gets the description of this FirmwareImage.
The description of the object
:return: The description of this FirmwareImage.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this FirmwareImage.
The description of the object
:param description: The description of this FirmwareImage.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this FirmwareImage.
The entity instance signature
:return: The etag of this FirmwareImage.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this FirmwareImage.
The entity instance signature
:param etag: The etag of this FirmwareImage.
:type: datetime
'''
pass
@property
def id(self):
'''
Gets the id of this FirmwareImage.
The firmware image ID
:return: The id of this FirmwareImage.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this FirmwareImage.
The firmware image ID
:param id: The id of this FirmwareImage.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this FirmwareImage.
The firmware image name
:return: The name of this FirmwareImage.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this FirmwareImage.
The firmware image name
:param name: The name of this FirmwareImage.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this FirmwareImage.
The API resource entity
:return: The object of this FirmwareImage.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this FirmwareImage.
The API resource entity
:param object: The object of this FirmwareImage.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this FirmwareImage.
The time the object was updated
:return: The updated_at of this FirmwareImage.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this FirmwareImage.
The time the object was updated
:param updated_at: The updated_at of this FirmwareImage.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 47 | 27 | 11 | 1 | 4 | 5 | 2 | 1 | 1 | 4 | 0 | 0 | 26 | 11 | 26 | 26 | 361 | 63 | 149 | 63 | 102 | 149 | 97 | 43 | 70 | 5 | 1 | 2 | 42 |
2,508 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/error_response_fields.py
|
mbed_cloud._backends.update_service.models.error_response_fields.ErrorResponseFields
|
class ErrorResponseFields(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'message': 'str',
'name': 'str'
}
attribute_map = {
'message': 'message',
'name': 'name'
}
def __init__(self, message=None, name=None):
"""
ErrorResponseFields - a model defined in Swagger
"""
self._message = message
self._name = name
self.discriminator = None
@property
def message(self):
"""
Gets the message of this ErrorResponseFields.
:return: The message of this ErrorResponseFields.
:rtype: str
"""
return self._message
@message.setter
def message(self, message):
"""
Sets the message of this ErrorResponseFields.
:param message: The message of this ErrorResponseFields.
:type: str
"""
self._message = message
@property
def name(self):
"""
Gets the name of this ErrorResponseFields.
:return: The name of this ErrorResponseFields.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this ErrorResponseFields.
:param name: The name of this ErrorResponseFields.
:type: str
"""
self._name = name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ErrorResponseFields):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class ErrorResponseFields(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, message=None, name=None):
'''
ErrorResponseFields - a model defined in Swagger
'''
pass
@property
def message(self):
'''
Gets the message of this ErrorResponseFields.
:return: The message of this ErrorResponseFields.
:rtype: str
'''
pass
@message.setter
def message(self):
'''
Sets the message of this ErrorResponseFields.
:param message: The message of this ErrorResponseFields.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this ErrorResponseFields.
:return: The name of this ErrorResponseFields.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this ErrorResponseFields.
:param name: The name of this ErrorResponseFields.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 15 | 11 | 9 | 1 | 4 | 4 | 2 | 0.89 | 1 | 3 | 0 | 0 | 10 | 3 | 10 | 10 | 127 | 23 | 55 | 23 | 40 | 49 | 35 | 19 | 24 | 5 | 1 | 2 | 15 |
2,509 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/update_campaign.py
|
mbed_cloud._backends.update_service.models.update_campaign.UpdateCampaign
|
class UpdateCampaign(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'autostop_reason': 'str',
'created_at': 'datetime',
'description': 'str',
'device_filter': 'str',
'etag': 'str',
'finished': 'datetime',
'health_indicator': 'str',
'id': 'str',
'name': 'str',
'object': 'str',
'phase': 'str',
'root_manifest_id': 'str',
'root_manifest_url': 'str',
'started_at': 'datetime',
'state': 'str',
'updated_at': 'datetime',
'when': 'datetime'
}
attribute_map = {
'autostop_reason': 'autostop_reason',
'created_at': 'created_at',
'description': 'description',
'device_filter': 'device_filter',
'etag': 'etag',
'finished': 'finished',
'health_indicator': 'health_indicator',
'id': 'id',
'name': 'name',
'object': 'object',
'phase': 'phase',
'root_manifest_id': 'root_manifest_id',
'root_manifest_url': 'root_manifest_url',
'started_at': 'started_at',
'state': 'state',
'updated_at': 'updated_at',
'when': 'when'
}
def __init__(self, autostop_reason=None, created_at=None, description=None, device_filter=None, etag=None, finished=None, health_indicator=None, id=None, name=None, object=None, phase=None, root_manifest_id=None, root_manifest_url=None, started_at=None, state=None, updated_at=None, when=None):
"""
UpdateCampaign - a model defined in Swagger
"""
self._autostop_reason = autostop_reason
self._created_at = created_at
self._description = description
self._device_filter = device_filter
self._etag = etag
self._finished = finished
self._health_indicator = health_indicator
self._id = id
self._name = name
self._object = object
self._phase = phase
self._root_manifest_id = root_manifest_id
self._root_manifest_url = root_manifest_url
self._started_at = started_at
self._state = state
self._updated_at = updated_at
self._when = when
self.discriminator = None
@property
def autostop_reason(self):
"""
Gets the autostop_reason of this UpdateCampaign.
Text description of why a campaign failed to start or why a campaign stopped.
:return: The autostop_reason of this UpdateCampaign.
:rtype: str
"""
return self._autostop_reason
@autostop_reason.setter
def autostop_reason(self, autostop_reason):
"""
Sets the autostop_reason of this UpdateCampaign.
Text description of why a campaign failed to start or why a campaign stopped.
:param autostop_reason: The autostop_reason of this UpdateCampaign.
:type: str
"""
self._autostop_reason = autostop_reason
@property
def created_at(self):
"""
Gets the created_at of this UpdateCampaign.
The time the update campaign was created
:return: The created_at of this UpdateCampaign.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this UpdateCampaign.
The time the update campaign was created
:param created_at: The created_at of this UpdateCampaign.
:type: datetime
"""
self._created_at = created_at
@property
def description(self):
"""
Gets the description of this UpdateCampaign.
An optional description of the campaign
:return: The description of this UpdateCampaign.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this UpdateCampaign.
An optional description of the campaign
:param description: The description of this UpdateCampaign.
:type: str
"""
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def device_filter(self):
"""
Gets the device_filter of this UpdateCampaign.
The filter for the devices the campaign is targeting at
:return: The device_filter of this UpdateCampaign.
:rtype: str
"""
return self._device_filter
@device_filter.setter
def device_filter(self, device_filter):
"""
Sets the device_filter of this UpdateCampaign.
The filter for the devices the campaign is targeting at
:param device_filter: The device_filter of this UpdateCampaign.
:type: str
"""
self._device_filter = device_filter
@property
def etag(self):
"""
Gets the etag of this UpdateCampaign.
The entity instance signature
:return: The etag of this UpdateCampaign.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this UpdateCampaign.
The entity instance signature
:param etag: The etag of this UpdateCampaign.
:type: str
"""
self._etag = etag
@property
def finished(self):
"""
Gets the finished of this UpdateCampaign.
The campaign finish timestamp
:return: The finished of this UpdateCampaign.
:rtype: datetime
"""
return self._finished
@finished.setter
def finished(self, finished):
"""
Sets the finished of this UpdateCampaign.
The campaign finish timestamp
:param finished: The finished of this UpdateCampaign.
:type: datetime
"""
self._finished = finished
@property
def health_indicator(self):
"""
Gets the health_indicator of this UpdateCampaign.
An indication to the condition of the campaign.
:return: The health_indicator of this UpdateCampaign.
:rtype: str
"""
return self._health_indicator
@health_indicator.setter
def health_indicator(self, health_indicator):
"""
Sets the health_indicator of this UpdateCampaign.
An indication to the condition of the campaign.
:param health_indicator: The health_indicator of this UpdateCampaign.
:type: str
"""
allowed_values = ["ok", "warning", "error"]
if health_indicator not in allowed_values:
raise ValueError(
"Invalid value for `health_indicator` ({0}), must be one of {1}"
.format(health_indicator, allowed_values)
)
self._health_indicator = health_indicator
@property
def id(self):
"""
Gets the id of this UpdateCampaign.
The campaign ID
:return: The id of this UpdateCampaign.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this UpdateCampaign.
The campaign ID
:param id: The id of this UpdateCampaign.
:type: str
"""
self._id = id
@property
def name(self):
"""
Gets the name of this UpdateCampaign.
The campaign name
:return: The name of this UpdateCampaign.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this UpdateCampaign.
The campaign name
:param name: The name of this UpdateCampaign.
:type: str
"""
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
@property
def object(self):
"""
Gets the object of this UpdateCampaign.
The API resource entity
:return: The object of this UpdateCampaign.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UpdateCampaign.
The API resource entity
:param object: The object of this UpdateCampaign.
:type: str
"""
self._object = object
@property
def phase(self):
"""
Gets the phase of this UpdateCampaign.
The current phase of the campaign.
:return: The phase of this UpdateCampaign.
:rtype: str
"""
return self._phase
@phase.setter
def phase(self, phase):
"""
Sets the phase of this UpdateCampaign.
The current phase of the campaign.
:param phase: The phase of this UpdateCampaign.
:type: str
"""
self._phase = phase
@property
def root_manifest_id(self):
"""
Gets the root_manifest_id of this UpdateCampaign.
:return: The root_manifest_id of this UpdateCampaign.
:rtype: str
"""
return self._root_manifest_id
@root_manifest_id.setter
def root_manifest_id(self, root_manifest_id):
"""
Sets the root_manifest_id of this UpdateCampaign.
:param root_manifest_id: The root_manifest_id of this UpdateCampaign.
:type: str
"""
self._root_manifest_id = root_manifest_id
@property
def root_manifest_url(self):
"""
Gets the root_manifest_url of this UpdateCampaign.
:return: The root_manifest_url of this UpdateCampaign.
:rtype: str
"""
return self._root_manifest_url
@root_manifest_url.setter
def root_manifest_url(self, root_manifest_url):
"""
Sets the root_manifest_url of this UpdateCampaign.
:param root_manifest_url: The root_manifest_url of this UpdateCampaign.
:type: str
"""
self._root_manifest_url = root_manifest_url
@property
def started_at(self):
"""
Gets the started_at of this UpdateCampaign.
:return: The started_at of this UpdateCampaign.
:rtype: datetime
"""
return self._started_at
@started_at.setter
def started_at(self, started_at):
"""
Sets the started_at of this UpdateCampaign.
:param started_at: The started_at of this UpdateCampaign.
:type: datetime
"""
self._started_at = started_at
@property
def state(self):
"""
Gets the state of this UpdateCampaign.
The state of the campaign
:return: The state of this UpdateCampaign.
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""
Sets the state of this UpdateCampaign.
The state of the campaign
:param state: The state of this UpdateCampaign.
:type: str
"""
allowed_values = ["draft", "scheduled", "allocatingquota", "allocatedquota", "quotaallocationfailed", "checkingmanifest", "checkedmanifest", "devicefetch", "devicecopy", "devicecheck", "publishing", "deploying", "deployed", "manifestremoved", "expired", "stopping", "autostopped", "userstopped", "conflict"]
if state not in allowed_values:
raise ValueError(
"Invalid value for `state` ({0}), must be one of {1}"
.format(state, allowed_values)
)
self._state = state
@property
def updated_at(self):
"""
Gets the updated_at of this UpdateCampaign.
The time the object was updated
:return: The updated_at of this UpdateCampaign.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this UpdateCampaign.
The time the object was updated
:param updated_at: The updated_at of this UpdateCampaign.
:type: datetime
"""
self._updated_at = updated_at
@property
def when(self):
"""
Gets the when of this UpdateCampaign.
The scheduled start time for the campaign. The campaign will start within 1 minute when then start time has elapsed.
:return: The when of this UpdateCampaign.
:rtype: datetime
"""
return self._when
@when.setter
def when(self, when):
"""
Sets the when of this UpdateCampaign.
The scheduled start time for the campaign. The campaign will start within 1 minute when then start time has elapsed.
:param when: The when of this UpdateCampaign.
:type: datetime
"""
self._when = when
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdateCampaign):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdateCampaign(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, autostop_reason=None, created_at=None, description=None, device_filter=None, etag=None, finished=None, health_indicator=None, id=None, name=None, object=None, phase=None, root_manifest_id=None, root_manifest_url=None, started_at=None, state=None, updated_at=None, when=None):
'''
UpdateCampaign - a model defined in Swagger
'''
pass
@property
def autostop_reason(self):
'''
Gets the autostop_reason of this UpdateCampaign.
Text description of why a campaign failed to start or why a campaign stopped.
:return: The autostop_reason of this UpdateCampaign.
:rtype: str
'''
pass
@autostop_reason.setter
def autostop_reason(self):
'''
Sets the autostop_reason of this UpdateCampaign.
Text description of why a campaign failed to start or why a campaign stopped.
:param autostop_reason: The autostop_reason of this UpdateCampaign.
:type: str
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this UpdateCampaign.
The time the update campaign was created
:return: The created_at of this UpdateCampaign.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this UpdateCampaign.
The time the update campaign was created
:param created_at: The created_at of this UpdateCampaign.
:type: datetime
'''
pass
@property
def description(self):
'''
Gets the description of this UpdateCampaign.
An optional description of the campaign
:return: The description of this UpdateCampaign.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this UpdateCampaign.
An optional description of the campaign
:param description: The description of this UpdateCampaign.
:type: str
'''
pass
@property
def device_filter(self):
'''
Gets the device_filter of this UpdateCampaign.
The filter for the devices the campaign is targeting at
:return: The device_filter of this UpdateCampaign.
:rtype: str
'''
pass
@device_filter.setter
def device_filter(self):
'''
Sets the device_filter of this UpdateCampaign.
The filter for the devices the campaign is targeting at
:param device_filter: The device_filter of this UpdateCampaign.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this UpdateCampaign.
The entity instance signature
:return: The etag of this UpdateCampaign.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this UpdateCampaign.
The entity instance signature
:param etag: The etag of this UpdateCampaign.
:type: str
'''
pass
@property
def finished(self):
'''
Gets the finished of this UpdateCampaign.
The campaign finish timestamp
:return: The finished of this UpdateCampaign.
:rtype: datetime
'''
pass
@finished.setter
def finished(self):
'''
Sets the finished of this UpdateCampaign.
The campaign finish timestamp
:param finished: The finished of this UpdateCampaign.
:type: datetime
'''
pass
@property
def health_indicator(self):
'''
Gets the health_indicator of this UpdateCampaign.
An indication to the condition of the campaign.
:return: The health_indicator of this UpdateCampaign.
:rtype: str
'''
pass
@health_indicator.setter
def health_indicator(self):
'''
Sets the health_indicator of this UpdateCampaign.
An indication to the condition of the campaign.
:param health_indicator: The health_indicator of this UpdateCampaign.
:type: str
'''
pass
@property
def id(self):
'''
Gets the id of this UpdateCampaign.
The campaign ID
:return: The id of this UpdateCampaign.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this UpdateCampaign.
The campaign ID
:param id: The id of this UpdateCampaign.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this UpdateCampaign.
The campaign name
:return: The name of this UpdateCampaign.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this UpdateCampaign.
The campaign name
:param name: The name of this UpdateCampaign.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this UpdateCampaign.
The API resource entity
:return: The object of this UpdateCampaign.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UpdateCampaign.
The API resource entity
:param object: The object of this UpdateCampaign.
:type: str
'''
pass
@property
def phase(self):
'''
Gets the phase of this UpdateCampaign.
The current phase of the campaign.
:return: The phase of this UpdateCampaign.
:rtype: str
'''
pass
@phase.setter
def phase(self):
'''
Sets the phase of this UpdateCampaign.
The current phase of the campaign.
:param phase: The phase of this UpdateCampaign.
:type: str
'''
pass
@property
def root_manifest_id(self):
'''
Gets the root_manifest_id of this UpdateCampaign.
:return: The root_manifest_id of this UpdateCampaign.
:rtype: str
'''
pass
@root_manifest_id.setter
def root_manifest_id(self):
'''
Sets the root_manifest_id of this UpdateCampaign.
:param root_manifest_id: The root_manifest_id of this UpdateCampaign.
:type: str
'''
pass
@property
def root_manifest_url(self):
'''
Gets the root_manifest_url of this UpdateCampaign.
:return: The root_manifest_url of this UpdateCampaign.
:rtype: str
'''
pass
@root_manifest_url.setter
def root_manifest_url(self):
'''
Sets the root_manifest_url of this UpdateCampaign.
:param root_manifest_url: The root_manifest_url of this UpdateCampaign.
:type: str
'''
pass
@property
def started_at(self):
'''
Gets the started_at of this UpdateCampaign.
:return: The started_at of this UpdateCampaign.
:rtype: datetime
'''
pass
@started_at.setter
def started_at(self):
'''
Sets the started_at of this UpdateCampaign.
:param started_at: The started_at of this UpdateCampaign.
:type: datetime
'''
pass
@property
def state(self):
'''
Gets the state of this UpdateCampaign.
The state of the campaign
:return: The state of this UpdateCampaign.
:rtype: str
'''
pass
@state.setter
def state(self):
'''
Sets the state of this UpdateCampaign.
The state of the campaign
:param state: The state of this UpdateCampaign.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this UpdateCampaign.
The time the object was updated
:return: The updated_at of this UpdateCampaign.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this UpdateCampaign.
The time the object was updated
:param updated_at: The updated_at of this UpdateCampaign.
:type: datetime
'''
pass
@property
def when(self):
'''
Gets the when of this UpdateCampaign.
The scheduled start time for the campaign. The campaign will start within 1 minute when then start time has elapsed.
:return: The when of this UpdateCampaign.
:rtype: datetime
'''
pass
@when.setter
def when(self):
'''
Sets the when of this UpdateCampaign.
The scheduled start time for the campaign. The campaign will start within 1 minute when then start time has elapsed.
:param when: The when of this UpdateCampaign.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 75 | 41 | 10 | 1 | 3 | 5 | 1 | 1.1 | 1 | 4 | 0 | 0 | 40 | 18 | 40 | 40 | 531 | 98 | 206 | 100 | 131 | 227 | 120 | 66 | 79 | 5 | 1 | 2 | 49 |
2,510 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/error_response.py
|
mbed_cloud._backends.update_service.models.error_response.ErrorResponse
|
class ErrorResponse(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'code': 'int',
'fields': 'list[ErrorResponseFields]',
'message': 'str',
'object': 'str',
'request_id': 'str',
'type': 'str'
}
attribute_map = {
'code': 'code',
'fields': 'fields',
'message': 'message',
'object': 'object',
'request_id': 'request_id',
'type': 'type'
}
def __init__(self, code=None, fields=None, message=None, object=None, request_id=None, type=None):
"""
ErrorResponse - a model defined in Swagger
"""
self._code = code
self._fields = fields
self._message = message
self._object = object
self._request_id = request_id
self._type = type
self.discriminator = None
@property
def code(self):
"""
Gets the code of this ErrorResponse.
Response code
:return: The code of this ErrorResponse.
:rtype: int
"""
return self._code
@code.setter
def code(self, code):
"""
Sets the code of this ErrorResponse.
Response code
:param code: The code of this ErrorResponse.
:type: int
"""
self._code = code
@property
def fields(self):
"""
Gets the fields of this ErrorResponse.
:return: The fields of this ErrorResponse.
:rtype: list[ErrorResponseFields]
"""
return self._fields
@fields.setter
def fields(self, fields):
"""
Sets the fields of this ErrorResponse.
:param fields: The fields of this ErrorResponse.
:type: list[ErrorResponseFields]
"""
self._fields = fields
@property
def message(self):
"""
Gets the message of this ErrorResponse.
:return: The message of this ErrorResponse.
:rtype: str
"""
return self._message
@message.setter
def message(self, message):
"""
Sets the message of this ErrorResponse.
:param message: The message of this ErrorResponse.
:type: str
"""
self._message = message
@property
def object(self):
"""
Gets the object of this ErrorResponse.
:return: The object of this ErrorResponse.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this ErrorResponse.
:param object: The object of this ErrorResponse.
:type: str
"""
self._object = object
@property
def request_id(self):
"""
Gets the request_id of this ErrorResponse.
:return: The request_id of this ErrorResponse.
:rtype: str
"""
return self._request_id
@request_id.setter
def request_id(self, request_id):
"""
Sets the request_id of this ErrorResponse.
:param request_id: The request_id of this ErrorResponse.
:type: str
"""
self._request_id = request_id
@property
def type(self):
"""
Gets the type of this ErrorResponse.
:return: The type of this ErrorResponse.
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""
Sets the type of this ErrorResponse.
:param type: The type of this ErrorResponse.
:type: str
"""
self._type = type
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ErrorResponse):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class ErrorResponse(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, code=None, fields=None, message=None, object=None, request_id=None, type=None):
'''
ErrorResponse - a model defined in Swagger
'''
pass
@property
def code(self):
'''
Gets the code of this ErrorResponse.
Response code
:return: The code of this ErrorResponse.
:rtype: int
'''
pass
@code.setter
def code(self):
'''
Sets the code of this ErrorResponse.
Response code
:param code: The code of this ErrorResponse.
:type: int
'''
pass
@property
def fields(self):
'''
Gets the fields of this ErrorResponse.
:return: The fields of this ErrorResponse.
:rtype: list[ErrorResponseFields]
'''
pass
@fields.setter
def fields(self):
'''
Sets the fields of this ErrorResponse.
:param fields: The fields of this ErrorResponse.
:type: list[ErrorResponseFields]
'''
pass
@property
def message(self):
'''
Gets the message of this ErrorResponse.
:return: The message of this ErrorResponse.
:rtype: str
'''
pass
@message.setter
def message(self):
'''
Sets the message of this ErrorResponse.
:param message: The message of this ErrorResponse.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this ErrorResponse.
:return: The object of this ErrorResponse.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this ErrorResponse.
:param object: The object of this ErrorResponse.
:type: str
'''
pass
@property
def request_id(self):
'''
Gets the request_id of this ErrorResponse.
:return: The request_id of this ErrorResponse.
:rtype: str
'''
pass
@request_id.setter
def request_id(self):
'''
Sets the request_id of this ErrorResponse.
:param request_id: The request_id of this ErrorResponse.
:type: str
'''
pass
@property
def type(self):
'''
Gets the type of this ErrorResponse.
:return: The type of this ErrorResponse.
:rtype: str
'''
pass
@type.setter
def type(self):
'''
Sets the type of this ErrorResponse.
:param type: The type of this ErrorResponse.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 31 | 19 | 9 | 1 | 3 | 4 | 1 | 1 | 1 | 3 | 0 | 0 | 18 | 7 | 18 | 18 | 225 | 43 | 91 | 43 | 60 | 91 | 55 | 31 | 36 | 5 | 1 | 2 | 23 |
2,511 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/account_management/account_management.py
|
mbed_cloud.account_management.account_management.AccountManagementAPI
|
class AccountManagementAPI(BaseAPI):
"""API reference for the AccountManagement API.
Exposing functionality for creating and managing accounts,
users, groups and API keys in the organisation.
"""
api_structure = {iam: [iam.DeveloperApi, iam.AccountAdminApi]}
@catch_exceptions(ApiException)
def list_api_keys(self, **kwargs):
"""List the API keys registered in the organisation.
List api keys Example:
.. code-block:: python
account_management_api = AccountManagementAPI()
# List api keys
api_keys_paginated_response = account_management_api.list_api_keys()
# get single api key
api_keys_paginated_response.data[0]
:param int limit: Number of API keys to get
:param str after: Entity ID after which to start fetching
:param str order: Order of the records to return (asc|desc)
:param dict filters: Dictionary of filters to apply: str owner (eq)
:returns: a list of :class:`ApiKey` objects
:rtype: PaginatedResponse
:raises: ApiException
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, ApiKey)
api = self._get_api(iam.DeveloperApi)
# Return the data array
return PaginatedResponse(api.get_all_api_keys, lwrap_type=ApiKey, **kwargs)
@catch_exceptions(ApiException)
def get_api_key(self, api_key_id):
"""Get API key details for key registered in organisation.
:param str api_key_id: The ID of the API key to be updated (Required)
:returns: API key object
:rtype: ApiKey
"""
api = self._get_api(iam.DeveloperApi)
return ApiKey(api.get_api_key(api_key_id))
@catch_exceptions(ApiException)
def delete_api_key(self, api_key_id):
"""Delete an API key registered in the organisation.
:param str api_key_id: The ID of the API key (Required)
:returns: void
"""
api = self._get_api(iam.DeveloperApi)
api.delete_api_key(api_key_id)
return
@catch_exceptions(ApiException)
def add_api_key(self, name, **kwargs):
"""Create new API key registered to organisation.
:param str name: The name of the API key (Required)
:param list groups: List of group IDs (`str`)
:param str owner: User ID owning the API key
:param str status: The status of the API key. Values: ACTIVE, INACTIVE
:returns: Newly created API key object
:rtype: ApiKey
"""
api = self._get_api(iam.DeveloperApi)
kwargs.update({'name': name})
api_key = ApiKey._create_request_map(kwargs)
body = iam.ApiKeyInfoReq(**api_key)
return ApiKey(api.create_api_key(body))
@catch_exceptions(ApiException)
def update_api_key(self, api_key_id, **kwargs):
"""Update API key.
:param str api_key_id: The ID of the API key to be updated (Required)
:param str name: The name of the API key
:param str owner: User ID owning the API key
:param str status: The status of the API key. Values: ACTIVE, INACTIVE
:returns: Newly created API key object
:rtype: ApiKey
"""
api = self._get_api(iam.DeveloperApi)
apikey = ApiKey._create_request_map(kwargs)
body = iam.ApiKeyUpdateReq(**apikey)
return ApiKey(api.update_api_key(api_key_id, body))
@catch_exceptions(ApiException)
def list_users(self, **kwargs):
"""List all users in organisation.
:param int limit: The number of users to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get users after/starting at given user ID
:param dict filters: Dictionary of filters to apply: str status (eq)
:returns: a list of :py:class:`User` objects
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, User)
api = self._get_api(iam.AccountAdminApi)
return PaginatedResponse(api.get_all_users, lwrap_type=User, **kwargs)
@catch_exceptions(ApiException)
def get_user(self, user_id):
"""Get user details of specified user.
:param str user_id: the ID of the user to get (Required)
:returns: the user object with details about the user.
:rtype: User
"""
api = self._get_api(iam.AccountAdminApi)
return User(api.get_user(user_id))
@catch_exceptions(ApiException)
def update_user(self, user_id, **kwargs):
"""Update user properties of specified user.
:param str user_id: The ID of the user to update (Required)
:param str username: The unique username of the user
:param str email: The unique email of the user
:param str full_name: The full name of the user
:param str password: The password string of the user.
:param str phone_number: Phone number of the user
:param bool terms_accepted: Is 'General Terms & Conditions' accepted
:param bool marketing_accepted: Is receiving marketing information accepted?
:returns: the updated user object
:rtype: User
"""
api = self._get_api(iam.AccountAdminApi)
user = User._create_request_map(kwargs)
body = iam.UserUpdateReq(**user)
return User(api.update_user(user_id, body))
@catch_exceptions(ApiException)
def delete_user(self, user_id):
"""Delete user specified user.
:param str user_id: the ID of the user to delete (Required)
:returns: void
"""
api = self._get_api(iam.AccountAdminApi)
api.delete_user(user_id)
return
@catch_exceptions(ApiException)
def add_user(self, username, email, **kwargs):
"""Create a new user with provided details.
Add user example:
.. code-block:: python
account_management_api = AccountManagementAPI()
# Add user
user = {
"username": "test_user",
"email": "test@gmail.com",
"phone_number": "0123456789"
}
new_user = account_management_api.add_user(**user)
:param str username: The unique username of the user (Required)
:param str email: The unique email of the user (Required)
:param str full_name: The full name of the user
:param list groups: List of group IDs (`str`) which this user belongs to
:param str password: The password string of the user
:param str phone_number: Phone number of the user
:param bool terms_accepted: 'General Terms & Conditions' have been accepted
:param bool marketing_accepted: Marketing Information opt-in
:returns: the new user object
:rtype: User
"""
api = self._get_api(iam.AccountAdminApi)
kwargs.update({'username': username, 'email': email})
user = User._create_request_map(kwargs)
body = iam.UserUpdateReq(**user)
return User(api.create_user(body))
@catch_exceptions(ApiException)
def get_account(self):
"""Get details of the current account.
:returns: an account object.
:rtype: Account
"""
api = self._get_api(iam.DeveloperApi)
return Account(api.get_my_account_info(include="limits, policies"))
@catch_exceptions(ApiException)
def update_account(self, **kwargs):
"""Update details of account associated with current API key.
:param str address_line1: Postal address line 1.
:param str address_line2: Postal address line 2.
:param str city: The city part of the postal address.
:param str display_name: The display name for the account.
:param str country: The country part of the postal address.
:param str company: The name of the company.
:param str state: The state part of the postal address.
:param str contact: The name of the contact person for this account.
:param str postal_code: The postal code part of the postal address.
:param str parent_id: The ID of the parent account.
:param str phone_number: The phone number of the company.
:param str email: Email address for this account.
:param list[str] aliases: List of aliases
:returns: an account object.
:rtype: Account
"""
api = self._get_api(iam.AccountAdminApi)
account = Account._create_request_map(kwargs)
body = AccountUpdateReq(**account)
return Account(api.update_my_account(body))
@catch_exceptions(ApiException)
def list_groups(self, **kwargs):
"""List all groups in organisation.
:param int limit: The number of groups to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get groups after/starting at given group ID
:returns: a list of :py:class:`Group` objects.
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
api = self._get_api(iam.DeveloperApi)
return PaginatedResponse(api.get_all_groups, lwrap_type=Group, **kwargs)
@catch_exceptions(ApiException)
def get_group(self, group_id):
"""Get details of the group.
:param str group_id: The group ID (Required)
:returns: :py:class:`Group` object.
:rtype: Group
"""
api = self._get_api(iam.DeveloperApi)
return Group(api.get_group_summary(group_id))
@catch_exceptions(ApiException)
def list_group_users(self, group_id, **kwargs):
"""List users of a group.
:param str group_id: The group ID (Required)
:param int limit: The number of users to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get API keys after/starting at given user ID
:returns: a list of :py:class:`User` objects.
:rtype: PaginatedResponse
"""
kwargs["group_id"] = group_id
kwargs = self._verify_sort_options(kwargs)
api = self._get_api(iam.AccountAdminApi)
return PaginatedResponse(api.get_users_of_group, lwrap_type=User, **kwargs)
@catch_exceptions(ApiException)
def list_group_api_keys(self, group_id, **kwargs):
"""List API keys of a group.
:param str group_id: The group ID (Required)
:param int limit: The number of api keys to retrieve.
:param str order: The ordering direction, ascending (asc) or descending (desc).
:param str after: Get API keys after/starting at given api key ID.
:returns: a list of :py:class:`ApiKey` objects.
:rtype: PaginatedResponse
"""
kwargs["group_id"] = group_id
kwargs = self._verify_sort_options(kwargs)
api = self._get_api(iam.DeveloperApi)
return PaginatedResponse(api.get_api_keys_of_group, lwrap_type=ApiKey, **kwargs)
|
class AccountManagementAPI(BaseAPI):
'''API reference for the AccountManagement API.
Exposing functionality for creating and managing accounts,
users, groups and API keys in the organisation.
'''
@catch_exceptions(ApiException)
def list_api_keys(self, **kwargs):
'''List the API keys registered in the organisation.
List api keys Example:
.. code-block:: python
account_management_api = AccountManagementAPI()
# List api keys
api_keys_paginated_response = account_management_api.list_api_keys()
# get single api key
api_keys_paginated_response.data[0]
:param int limit: Number of API keys to get
:param str after: Entity ID after which to start fetching
:param str order: Order of the records to return (asc|desc)
:param dict filters: Dictionary of filters to apply: str owner (eq)
:returns: a list of :class:`ApiKey` objects
:rtype: PaginatedResponse
:raises: ApiException
'''
pass
@catch_exceptions(ApiException)
def get_api_key(self, api_key_id):
'''Get API key details for key registered in organisation.
:param str api_key_id: The ID of the API key to be updated (Required)
:returns: API key object
:rtype: ApiKey
'''
pass
@catch_exceptions(ApiException)
def delete_api_key(self, api_key_id):
'''Delete an API key registered in the organisation.
:param str api_key_id: The ID of the API key (Required)
:returns: void
'''
pass
@catch_exceptions(ApiException)
def add_api_key(self, name, **kwargs):
'''Create new API key registered to organisation.
:param str name: The name of the API key (Required)
:param list groups: List of group IDs (`str`)
:param str owner: User ID owning the API key
:param str status: The status of the API key. Values: ACTIVE, INACTIVE
:returns: Newly created API key object
:rtype: ApiKey
'''
pass
@catch_exceptions(ApiException)
def update_api_key(self, api_key_id, **kwargs):
'''Update API key.
:param str api_key_id: The ID of the API key to be updated (Required)
:param str name: The name of the API key
:param str owner: User ID owning the API key
:param str status: The status of the API key. Values: ACTIVE, INACTIVE
:returns: Newly created API key object
:rtype: ApiKey
'''
pass
@catch_exceptions(ApiException)
def list_users(self, **kwargs):
'''List all users in organisation.
:param int limit: The number of users to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get users after/starting at given user ID
:param dict filters: Dictionary of filters to apply: str status (eq)
:returns: a list of :py:class:`User` objects
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(ApiException)
def get_user(self, user_id):
'''Get user details of specified user.
:param str user_id: the ID of the user to get (Required)
:returns: the user object with details about the user.
:rtype: User
'''
pass
@catch_exceptions(ApiException)
def update_user(self, user_id, **kwargs):
'''Update user properties of specified user.
:param str user_id: The ID of the user to update (Required)
:param str username: The unique username of the user
:param str email: The unique email of the user
:param str full_name: The full name of the user
:param str password: The password string of the user.
:param str phone_number: Phone number of the user
:param bool terms_accepted: Is 'General Terms & Conditions' accepted
:param bool marketing_accepted: Is receiving marketing information accepted?
:returns: the updated user object
:rtype: User
'''
pass
@catch_exceptions(ApiException)
def delete_user(self, user_id):
'''Delete user specified user.
:param str user_id: the ID of the user to delete (Required)
:returns: void
'''
pass
@catch_exceptions(ApiException)
def add_user(self, username, email, **kwargs):
'''Create a new user with provided details.
Add user example:
.. code-block:: python
account_management_api = AccountManagementAPI()
# Add user
user = {
"username": "test_user",
"email": "test@gmail.com",
"phone_number": "0123456789"
}
new_user = account_management_api.add_user(**user)
:param str username: The unique username of the user (Required)
:param str email: The unique email of the user (Required)
:param str full_name: The full name of the user
:param list groups: List of group IDs (`str`) which this user belongs to
:param str password: The password string of the user
:param str phone_number: Phone number of the user
:param bool terms_accepted: 'General Terms & Conditions' have been accepted
:param bool marketing_accepted: Marketing Information opt-in
:returns: the new user object
:rtype: User
'''
pass
@catch_exceptions(ApiException)
def get_account(self):
'''Get details of the current account.
:returns: an account object.
:rtype: Account
'''
pass
@catch_exceptions(ApiException)
def update_account(self, **kwargs):
'''Update details of account associated with current API key.
:param str address_line1: Postal address line 1.
:param str address_line2: Postal address line 2.
:param str city: The city part of the postal address.
:param str display_name: The display name for the account.
:param str country: The country part of the postal address.
:param str company: The name of the company.
:param str state: The state part of the postal address.
:param str contact: The name of the contact person for this account.
:param str postal_code: The postal code part of the postal address.
:param str parent_id: The ID of the parent account.
:param str phone_number: The phone number of the company.
:param str email: Email address for this account.
:param list[str] aliases: List of aliases
:returns: an account object.
:rtype: Account
'''
pass
@catch_exceptions(ApiException)
def list_groups(self, **kwargs):
'''List all groups in organisation.
:param int limit: The number of groups to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get groups after/starting at given group ID
:returns: a list of :py:class:`Group` objects.
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(ApiException)
def get_group(self, group_id):
'''Get details of the group.
:param str group_id: The group ID (Required)
:returns: :py:class:`Group` object.
:rtype: Group
'''
pass
@catch_exceptions(ApiException)
def list_group_users(self, group_id, **kwargs):
'''List users of a group.
:param str group_id: The group ID (Required)
:param int limit: The number of users to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get API keys after/starting at given user ID
:returns: a list of :py:class:`User` objects.
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(ApiException)
def list_group_api_keys(self, group_id, **kwargs):
'''List API keys of a group.
:param str group_id: The group ID (Required)
:param int limit: The number of api keys to retrieve.
:param str order: The ordering direction, ascending (asc) or descending (desc).
:param str after: Get API keys after/starting at given api key ID.
:returns: a list of :py:class:`ApiKey` objects.
:rtype: PaginatedResponse
'''
pass
| 33 | 17 | 15 | 2 | 4 | 9 | 1 | 1.64 | 1 | 11 | 11 | 0 | 16 | 0 | 16 | 23 | 278 | 43 | 89 | 60 | 56 | 146 | 73 | 44 | 56 | 1 | 2 | 0 | 16 |
2,512 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/bootstrap/bootstrap.py
|
mbed_cloud.bootstrap.bootstrap.BootstrapAPI
|
class BootstrapAPI(BaseAPI):
"""API reference for the Bootstrap API."""
api_structure = {bootstrap: [bootstrap.PreSharedKeysApi]}
@catch_exceptions(BootstrapAPIException)
def add_psk(self, **kwargs):
"""Add"""
api = self._get_api(bootstrap.PreSharedKeysApi)
item = PreSharedKey._create_request_map(kwargs)
item = models.PreSharedKey(**item)
api.upload_pre_shared_key(item)
return PreSharedKey(item)
@catch_exceptions(BootstrapAPIException)
def get_psk(self, endpoint_name, **kwargs):
"""Get"""
api = self._get_api(bootstrap.PreSharedKeysApi)
return PreSharedKey(api.get_pre_shared_key(endpoint_name=endpoint_name))
@catch_exceptions(BootstrapAPIException)
def list_psks(self, **kwargs):
"""List"""
api = self._get_api(bootstrap.PreSharedKeysApi)
return PaginatedResponse(api.list_pre_shared_keys, lwrap_type=PreSharedKey, **kwargs)
@catch_exceptions(BootstrapAPIException)
def delete_psk(self, endpoint_name, **kwargs):
"""Delete"""
api = self._get_api(bootstrap.PreSharedKeysApi)
return api.delete_pre_shared_key(endpoint_name=endpoint_name)
|
class BootstrapAPI(BaseAPI):
'''API reference for the Bootstrap API.'''
@catch_exceptions(BootstrapAPIException)
def add_psk(self, **kwargs):
'''Add'''
pass
@catch_exceptions(BootstrapAPIException)
def get_psk(self, endpoint_name, **kwargs):
'''Get'''
pass
@catch_exceptions(BootstrapAPIException)
def list_psks(self, **kwargs):
'''List'''
pass
@catch_exceptions(BootstrapAPIException)
def delete_psk(self, endpoint_name, **kwargs):
'''Delete'''
pass
| 9 | 5 | 5 | 0 | 4 | 1 | 1 | 0.24 | 1 | 4 | 4 | 0 | 4 | 0 | 4 | 11 | 31 | 5 | 21 | 15 | 12 | 5 | 17 | 11 | 12 | 1 | 2 | 0 | 4 |
2,513 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/certificates/certificates.py
|
mbed_cloud.certificates.certificates.CertificatesAPI
|
class CertificatesAPI(BaseAPI):
"""Certificates API reference."""
api_structure = {
cert: [cert.DeveloperCertificateApi, cert.ServerCredentialsApi],
iam: [iam.AccountAdminApi, iam.DeveloperApi],
}
def __init__(self, params=None):
"""A module to access this section of the Pelion Device Management API.
:param params: Dictionary to override configuration values
"""
super(CertificatesAPI, self).__init__(params)
self.auth = self.api_clients[cert].configuration.api_key['Authorization']
@catch_exceptions(IamApiException)
def list_certificates(self, **kwargs):
"""List certificates registered to organisation.
Currently returns partially populated certificates. To obtain the full certificate object:
`[get_certificate(certificate_id=cert['id']) for cert in list_certificates]`
:param int limit: The number of certificates to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc).
:param str after: Get certificates after/starting at given `certificate_id`.
:param dict filters: Dictionary of filters to apply: type (eq), expire (eq), owner (eq)
:return: list of :py:class:`Certificate` objects
:rtype: Certificate
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, Certificate)
if "service__eq" in kwargs:
if kwargs["service__eq"] == CertificateType.bootstrap:
pass
elif kwargs["service__eq"] == CertificateType.developer:
kwargs["device_execution_mode__eq"] = 1
kwargs.pop("service__eq")
elif kwargs["service__eq"] == CertificateType.lwm2m:
pass
else:
raise CloudValueError(
"Incorrect value for CertificateType filter: %s" % (
kwargs["service__eq"])
)
owner = kwargs.pop('owner_id__eq', None)
if owner is not None:
kwargs['owner__eq'] = owner
api = self._get_api(iam.DeveloperApi)
return PaginatedResponse(api.get_all_certificates, lwrap_type=Certificate, **kwargs)
@catch_exceptions(CaApiException, IamApiException)
def get_certificate(self, certificate_id):
"""Get certificate by id.
:param str certificate_id: The certificate id (Required)
:returns: Certificate object
:rtype: Certificate
"""
api = self._get_api(iam.DeveloperApi)
certificate = Certificate(api.get_certificate(certificate_id))
self._extend_certificate(certificate)
return certificate
def _extend_certificate(self, certificate):
# extend certificate with developer_certificate properties
if certificate.type == CertificateType.developer:
dev_api = self._get_api(cert.DeveloperCertificateApi)
dev_cert = dev_api.get_developer_certificate(
certificate.id, self.auth)
certificate.update_attributes(dev_cert)
elif certificate.type == CertificateType.bootstrap:
server_api = self._get_api(cert.ServerCredentialsApi)
credentials = server_api.get_bootstrap_server_credentials(
self.auth)
certificate.update_attributes(credentials)
elif certificate.type == CertificateType.lwm2m:
server_api = self._get_api(cert.ServerCredentialsApi)
credentials = server_api.get_l2_m2_m_server_credentials(self.auth)
certificate.update_attributes(credentials)
@catch_exceptions(IamApiException)
def delete_certificate(self, certificate_id):
"""Delete a certificate.
:param str certificate_id: The certificate id (Required)
:returns: void
"""
api = self._get_api(iam.DeveloperApi)
api.delete_certificate(certificate_id)
return
@catch_exceptions(CaApiException, IamApiException)
def add_certificate(self, name, type, certificate_data, signature=None, **kwargs):
"""Add a new BYOC certificate.
:param str name: name of the certificate (Required)
:param str type: type of the certificate. Values: lwm2m or bootstrap (Required)
:param str certificate_data: X509.v3 trusted certificate in PEM format. (Required)
:param str signature: This parameter has been DEPRECATED in the API and does not need to
be provided.
:param str status: Status of the certificate.
Allowed values: "ACTIVE" | "INACTIVE".
:param str description: Human readable description of this certificate,
not longer than 500 characters.
:returns: Certificate object
:rtype: Certificate
"""
kwargs.update({'name': name})
kwargs.update({'type': type})
api = self._get_api(iam.AccountAdminApi)
kwargs.update({'certificate_data': certificate_data})
certificate = Certificate._create_request_map(kwargs)
if not certificate.get('enrollment_mode') and signature:
certificate.update({'signature': signature})
body = iam.TrustedCertificateReq(**certificate)
prod_cert = api.add_certificate(body)
return self.get_certificate(prod_cert.id)
@catch_exceptions(CaApiException, IamApiException)
def add_developer_certificate(self, name, **kwargs):
"""Add a new developer certificate.
:param str name: name of the certificate (Required)
:param str description: Human readable description of this certificate,
not longer than 500 characters.
:returns: Certificate object
:rtype: Certificate
"""
kwargs['name'] = name
api = self._get_api(cert.DeveloperCertificateApi)
certificate = Certificate._create_request_map(kwargs)
# just pull the fields we care about
subset = cert.DeveloperCertificateRequestData.attribute_map
certificate = {k: v for k, v in certificate.items() if k in subset}
body = cert.DeveloperCertificateRequestData(**certificate)
dev_cert = api.create_developer_certificate(self.auth, body)
return self.get_certificate(dev_cert.id)
@catch_exceptions(IamApiException)
def update_certificate(self, certificate_id, **kwargs):
"""Update a certificate.
:param str certificate_id: The certificate id (Required)
:param str certificate_data: X509.v3 trusted certificate in PEM format.
:param str signature: This parameter has been DEPRECATED in the API and does not need to
be provided.
:param str type: type of the certificate. Values: lwm2m or bootstrap.
:param str status: Status of the certificate.
Allowed values: "ACTIVE" | "INACTIVE".
:param str description: Human readable description of this certificate,
not longer than 500 characters.
:returns: Certificate object
:rtype: Certificate
"""
api = self._get_api(iam.DeveloperApi)
cert = Certificate._create_request_map(kwargs)
body = iam.TrustedCertificateReq(**cert)
certificate = Certificate(api.update_certificate(certificate_id, body))
return self.get_certificate(certificate.id)
|
class CertificatesAPI(BaseAPI):
'''Certificates API reference.'''
def __init__(self, params=None):
'''A module to access this section of the Pelion Device Management API.
:param params: Dictionary to override configuration values
'''
pass
@catch_exceptions(IamApiException)
def list_certificates(self, **kwargs):
'''List certificates registered to organisation.
Currently returns partially populated certificates. To obtain the full certificate object:
`[get_certificate(certificate_id=cert['id']) for cert in list_certificates]`
:param int limit: The number of certificates to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc).
:param str after: Get certificates after/starting at given `certificate_id`.
:param dict filters: Dictionary of filters to apply: type (eq), expire (eq), owner (eq)
:return: list of :py:class:`Certificate` objects
:rtype: Certificate
'''
pass
@catch_exceptions(CaApiException, IamApiException)
def get_certificate(self, certificate_id):
'''Get certificate by id.
:param str certificate_id: The certificate id (Required)
:returns: Certificate object
:rtype: Certificate
'''
pass
def _extend_certificate(self, certificate):
pass
@catch_exceptions(IamApiException)
def delete_certificate(self, certificate_id):
'''Delete a certificate.
:param str certificate_id: The certificate id (Required)
:returns: void
'''
pass
@catch_exceptions(CaApiException, IamApiException)
def add_certificate(self, name, type, certificate_data, signature=None, **kwargs):
'''Add a new BYOC certificate.
:param str name: name of the certificate (Required)
:param str type: type of the certificate. Values: lwm2m or bootstrap (Required)
:param str certificate_data: X509.v3 trusted certificate in PEM format. (Required)
:param str signature: This parameter has been DEPRECATED in the API and does not need to
be provided.
:param str status: Status of the certificate.
Allowed values: "ACTIVE" | "INACTIVE".
:param str description: Human readable description of this certificate,
not longer than 500 characters.
:returns: Certificate object
:rtype: Certificate
'''
pass
@catch_exceptions(CaApiException, IamApiException)
def add_developer_certificate(self, name, **kwargs):
'''Add a new developer certificate.
:param str name: name of the certificate (Required)
:param str description: Human readable description of this certificate,
not longer than 500 characters.
:returns: Certificate object
:rtype: Certificate
'''
pass
@catch_exceptions(IamApiException)
def update_certificate(self, certificate_id, **kwargs):
'''Update a certificate.
:param str certificate_id: The certificate id (Required)
:param str certificate_data: X509.v3 trusted certificate in PEM format.
:param str signature: This parameter has been DEPRECATED in the API and does not need to
be provided.
:param str type: type of the certificate. Values: lwm2m or bootstrap.
:param str status: Status of the certificate.
Allowed values: "ACTIVE" | "INACTIVE".
:param str description: Human readable description of this certificate,
not longer than 500 characters.
:returns: Certificate object
:rtype: Certificate
'''
pass
| 15 | 8 | 18 | 1 | 9 | 7 | 2 | 0.72 | 1 | 10 | 9 | 0 | 8 | 1 | 8 | 15 | 161 | 20 | 82 | 39 | 67 | 59 | 66 | 33 | 57 | 6 | 2 | 2 | 17 |
2,514 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/connect/connect.py
|
mbed_cloud.connect.connect.ConnectAPI
|
class ConnectAPI(BaseAPI):
"""API reference for the Connect API.
Exposing functionality for doing a range of device related actions:
- Listing connected devices
- Exploring and managing resources and resource values on connected devices
- Setup resource subscriptions and webhooks for resource monitoring
"""
api_structure = {
mds: [
mds.EndpointsApi,
mds.NotificationsApi,
mds.DeviceRequestsApi,
mds.ResourcesApi,
mds.SubscriptionsApi
],
statistics: [statistics.AccountApi, statistics.StatisticsApi],
device_directory: [device_directory.DefaultApi],
}
def __init__(self, params=None):
"""A module to access this section of the Pelion Device Management API.
:param params: Dictionary to override configuration values
: autostart_notification_thread : Automatically starts a thread
if needed for Async APIs (e.g. get_resource_value).
This should be set to False when using webhooks for notifications.
"""
super(ConnectAPI, self).__init__(params)
self._db = {}
self._queues = defaultdict(dict)
self.b64decode = True
self._notifications_thread = None
self._notifications_lock = threading.RLock()
self.subscribe = SubscriptionsManager(self)
@property
def has_active_notification_thread(self):
"""Has active notification thread"""
with self._notifications_lock:
return bool(self._notifications_thread)
def ensure_notifications_thread(self):
"""Ensure notification thread is running"""
if self.config.get('autostart_notification_thread'):
if not self.has_active_notification_thread:
self.start_notifications()
def start_notifications(self):
"""Start the notifications thread.
If an external callback is not set up (using `update_webhook`) then
calling this function is mandatory to get or set resource.
.. code-block:: python
>>> api.start_notifications()
>>> print(api.get_resource_value(device, path))
Some value
>>> api.stop_notifications()
:returns: void
"""
with self._notifications_lock:
if self.has_active_notification_thread:
return
api = self._get_api(mds.NotificationsApi)
self._notifications_thread = NotificationsThread(
self._db,
self._queues,
b64decode=self.b64decode,
notifications_api=api,
subscription_manager=self.subscribe,
)
self._notifications_thread.daemon = True
self._notifications_thread.start()
def stop_notifications(self):
"""Stop the notifications thread.
:returns:
"""
with self._notifications_lock:
if not self.has_active_notification_thread:
return
thread = self._notifications_thread
self._notifications_thread = None
stopping = thread.stop()
api = self._get_api(mds.NotificationsApi)
api.delete_long_poll_channel()
return stopping.wait()
@catch_exceptions(device_directory.rest.ApiException)
def list_connected_devices(self, **kwargs):
"""List connected devices.
Example usage, listing all registered devices in the catalog:
.. code-block:: python
filters = {
'created_at': {'$gte': datetime.datetime(2017,01,01),
'$lte': datetime.datetime(2017,12,31)
}
}
devices = api.list_connected_devices(order='asc', filters=filters)
for idx, device in enumerate(devices):
print(device)
## Other example filters
# Directly connected devices (not via gateways):
filters = {
'host_gateway': {'$eq': ''},
'device_type': {'$eq': ''}
}
# Devices connected via gateways:
filters = {
'host_gateway': {'$neq': ''}
}
# Gateway devices:
filters = {
'device_type': {'$eq': 'MBED_GW'}
}
:param int limit: The number of devices to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get devices after/starting at given `device_id`
:param filters: Dictionary of filters to apply.
:returns: a list of connected :py:class:`Device` objects.
:rtype: PaginatedResponse
"""
# TODO(pick one of these)
filter_or_filters = 'filter' if 'filter' in kwargs else 'filters'
kwargs.setdefault(filter_or_filters, {}).setdefault(
'state', {'$eq': 'registered'})
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, Device, True)
api = self._get_api(device_directory.DefaultApi)
return PaginatedResponse(api.device_list, lwrap_type=Device, **kwargs)
@catch_exceptions(mds.rest.ApiException)
def list_resources(self, device_id):
"""List all resources registered to a connected device.
.. code-block:: python
>>> for r in api.list_resources(device_id):
print(r.name, r.observable, r.uri)
None,True,/3/0/1
Update,False,/5/0/3
...
:param str device_id: The ID of the device (Required)
:returns: A list of :py:class:`Resource` objects for the device
:rtype: list
"""
api = self._get_api(mds.EndpointsApi)
return [Resource(r) for r in api.get_endpoint_resources(device_id)]
@catch_exceptions(mds.rest.ApiException)
def get_resource(self, device_id, resource_path):
"""Get a resource.
:param str device_id: ID of the device (Required)
:param str path: Path of the resource to get (Required)
:returns: Device resource
:rtype Resource
"""
resources = self.list_resources(device_id)
for r in resources:
if r.path == resource_path:
return r
raise CloudApiException("Resource not found")
def _mds_rpc_post(self, device_id, _wrap_with_consumer=True, async_id=None, **params):
"""Helper for using RPC endpoint"""
self.ensure_notifications_thread()
api = self._get_api(mds.DeviceRequestsApi)
async_id = async_id or utils.new_async_id()
device_request = mds.DeviceRequest(**params)
api.create_async_request(
device_id,
async_id=async_id,
body=device_request,
)
return AsyncConsumer(async_id, self._db) if _wrap_with_consumer else async_id
@catch_exceptions(mds.rest.ApiException)
def get_resource_value_async(self, device_id, resource_path, fix_path=True):
"""Get a resource value for a given device and resource path.
Will not block, but instead return an AsyncConsumer. Example usage:
.. code-block:: python
a = api.get_resource_value_async(device, path)
while not a.is_done:
time.sleep(0.1)
if a.error:
print("Error", a.error)
print("Current value", a.value)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to get (Required)
:param bool fix_path: strip leading / of path if present
:returns: Consumer object to control asynchronous request
:rtype: AsyncConsumer
"""
return self._mds_rpc_post(device_id=device_id, method='GET', uri=resource_path)
@catch_exceptions(mds.rest.ApiException)
def get_resource_value(self, device_id, resource_path, fix_path=True, timeout=None):
"""Get a resource value for a given device and resource path by blocking thread.
Example usage:
.. code-block:: python
try:
v = api.get_resource_value(device_id, path)
print("Current value", v)
except CloudAsyncError, e:
print("Error", e)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to get (Required)
:param fix_path: if True then the leading /, if found, will be stripped before
doing request to backend. This is a requirement for the API to work properly
:param timeout: Seconds to request value for before timeout. If not provided, the
program might hang indefinitely.
:raises: CloudAsyncError, CloudTimeoutError
:returns: The resource value for the requested resource path
:rtype: str
"""
return self.get_resource_value_async(device_id, resource_path, fix_path).wait(timeout)
@catch_exceptions(mds.rest.ApiException)
def set_resource_value(self, device_id, resource_path, resource_value,
fix_path=True, timeout=None):
"""Set resource value for given resource path, on device.
Will block and wait for response to come through. Usage:
.. code-block:: python
try:
v = api.set_resource_value(device, path, value)
print("Success, new value:", v)
except AsyncError, e:
print("Error", e)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param str resource_value: The new value to set for given path
:param fix_path: Unused
:param timeout: Timeout in seconds
:raises: AsyncError
:returns: The value of the new resource
:rtype: str
"""
self.ensure_notifications_thread()
return self.set_resource_value_async(
device_id, resource_path, resource_value
).wait(timeout)
@staticmethod
def _base64_encode(resource_value):
"""Base64 encode the value in a Python version agnostic way.
Use encode and decode to covert to and from a bytes object which b64encode will encode.
"""
if resource_value is None:
return ""
else:
return base64.b64encode(str(resource_value).encode("utf-8")).decode("utf-8")
@catch_exceptions(mds.rest.ApiException)
def set_resource_value_async(self, device_id, resource_path,
resource_value=None, fix_path=True):
"""Set resource value for given resource path, on device.
Will not block. Returns immediately. Usage:
.. code-block:: python
a = api.set_resource_value_async(device, path, value)
while not a.is_done:
time.sleep(0.1)
if a.error:
print("Error", a.error)
print("Success, new value:", a.value)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param str resource_value: The new value to set for given path
:param fix_path: Unused
:returns: An async consumer object holding reference to request
:rtype: AsyncConsumer
"""
payload_b64 = self._base64_encode(resource_value)
if not resource_path.startswith("/"):
resource_path = "/" + resource_path
return self._mds_rpc_post(
device_id,
method='PUT',
uri=resource_path,
content_type="text/plain",
payload_b64=payload_b64
)
@catch_exceptions(mds.rest.ApiException)
def execute_resource(self, device_id, resource_path, fix_path=True, timeout=None):
"""Execute a function on a resource.
Will block and wait for response to come through. Usage:
.. code-block:: python
try:
v = api.execute_resource(device, path)
print("Success, returned value:", v)
except AsyncError, e:
print("Error", e)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param str resource_function: Unused
:param fix_path: Unused
:param timeout: Timeout in seconds
:raises: AsyncError
:returns: The value returned from the function executed on the resource
:rtype: str
"""
self.ensure_notifications_thread()
return self.execute_resource_async(device_id, resource_path).wait(timeout)
@catch_exceptions(mds.rest.ApiException)
def execute_resource_async(self, device_id, resource_path, fix_path=True):
"""Execute a function on a resource.
Will not block. Returns immediately. Usage:
.. code-block:: python
a = api.execute_resource_async(device, path)
while not a.is_done:
time.sleep(0.1)
if a.error:
print("Error", a.error)
print("Success, returned value:", a.value)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param fix_path: Unused
:returns: An async consumer object holding reference to request
:rtype: AsyncConsumer
"""
if not resource_path.startswith("/"):
resource_path = "/" + resource_path
return self._mds_rpc_post(device_id=device_id, method='POST', uri=resource_path)
@catch_exceptions(mds.rest.ApiException)
def _add_subscription(self, device_id, resource_path):
api = self._get_api(mds.SubscriptionsApi)
return api.add_resource_subscription(device_id, resource_path)
@catch_exceptions(mds.rest.ApiException)
def add_resource_subscription(self, device_id, resource_path, fix_path=True, queue_size=5):
"""Subscribe to resource updates.
When called on a valid device and resource path a subscription is setup so that
any update on the resource path value triggers a new element on the FIFO queue.
The returned object is a native Python Queue object.
:param device_id: Name of device to subscribe on (Required)
:param resource_path: The resource path on device to observe (Required)
:param fix_path: Removes leading / on resource_path if found
:param queue_size: Sets the Queue size. If set to 0, no queue object will be created
:returns: a queue of resource updates
:rtype: Queue
"""
# When path starts with / we remove the slash, as the API can't handle //.
# Keep the original path around however, as we use that for queue registration.
fixed_path = resource_path
if fix_path and resource_path.startswith("/"):
fixed_path = resource_path[1:]
# Create the queue and register it with the dict holding all queues
q = queue.Queue(queue_size) if queue_size > 0 else None
self._queues[device_id][resource_path] = q
# Send subscription request
self._add_subscription(device_id, fixed_path)
# Return the Queue object to the user
return q
@catch_exceptions(mds.rest.ApiException)
def add_resource_subscription_async(self, device_id, resource_path, callback_fn,
fix_path=True, queue_size=5):
"""Subscribe to resource updates with callback function.
When called on a valid device and resource path a subscription is setup so that
any update on the resource path value triggers an update on the callback function.
:param device_id: Name of device to set the subscription on (Required)
:param resource_path: The resource path on device to observe (Required)
:param callback_fn: Callback function to be executed on update to subscribed resource
:param fix_path: Removes leading / on resource_path if found
:param queue_size: Sets the Queue size. If set to 0, no queue object will be created
:returns: void
"""
queue = self.add_resource_subscription(
device_id, resource_path, fix_path, queue_size)
# Setup daemon thread for callback function
t = threading.Thread(target=self._subscription_handler,
args=[queue, device_id, resource_path, callback_fn])
t.daemon = True
t.start()
@catch_exceptions(mds.rest.ApiException)
def get_resource_subscription(self, device_id, resource_path, fix_path=True):
"""Read subscription status.
:param device_id: Name of device to set the subscription on (Required)
:param resource_path: The resource path on device to observe (Required)
:param fix_path: Removes leading / on resource_path if found
:returns: status of subscription
"""
# When path starts with / we remove the slash, as the API can't handle //.
# Keep the original path around however, as we use that for queue registration.
fixed_path = resource_path
if fix_path and resource_path.startswith("/"):
fixed_path = resource_path[1:]
api = self._get_api(mds.SubscriptionsApi)
try:
api.check_resource_subscription(device_id, fixed_path)
except Exception as e:
if e.status == 404:
return False
raise
return True
@catch_exceptions(mds.rest.ApiException)
def update_presubscriptions(self, presubscriptions):
"""Update pre-subscription data. Pre-subscription data will be removed for empty list.
:param presubscriptions: list of `Presubscription` objects (Required)
:returns: None
"""
api = self._get_api(mds.SubscriptionsApi)
presubscriptions_list = []
for presubscription in presubscriptions:
if not isinstance(presubscription, dict):
presubscription = presubscription.to_dict()
presubscription = {
"endpoint_name": presubscription.get("device_id", None),
"endpoint_type": presubscription.get("device_type", None),
"_resource_path": presubscription.get("resource_paths", None)
}
presubscriptions_list.append(
PresubscriptionData(**presubscription))
return api.update_pre_subscriptions(presubscriptions_list)
@catch_exceptions(mds.rest.ApiException)
def delete_presubscriptions(self):
"""Deletes pre-subscription data.
:returns: None
"""
api = self._get_api(mds.SubscriptionsApi)
return api.update_pre_subscriptions([])
@catch_exceptions(mds.rest.ApiException)
def delete_subscriptions(self):
"""Remove all subscriptions.
Warning: This could be slow for large numbers of connected devices.
If possible, explicitly delete subscriptions known to have been created.
:returns: None
"""
warnings.warn('This could be slow for large numbers of connected devices.'
'If possible, explicitly delete subscriptions known to have been created.')
for device in self.list_connected_devices():
try:
self.delete_device_subscriptions(device_id=device.id)
except CloudApiException as e:
LOG.warning(
'failed to remove subscription for %s: %s', device.id, e)
continue
@catch_exceptions(mds.rest.ApiException)
def list_presubscriptions(self, **kwargs):
"""Get a list of pre-subscription data
:returns: a list of `Presubscription` objects
:rtype: list of mbed_cloud.presubscription.Presubscription
"""
api = self._get_api(mds.SubscriptionsApi)
resp = api.get_pre_subscriptions(**kwargs)
return [Presubscription(p) for p in resp]
@catch_exceptions(mds.rest.ApiException)
def list_device_subscriptions(self, device_id, **kwargs):
"""Lists all subscribed resources from a single device
:param device_id: ID of the device (Required)
:returns: a list of subscribed resources
:rtype: list of str
"""
api = self._get_api(mds.SubscriptionsApi)
resp = api.get_endpoint_subscriptions(device_id, **kwargs)
return resp.split("\n")
@catch_exceptions(mds.rest.ApiException)
def delete_device_subscriptions(self, device_id):
"""Removes a device's subscriptions
:param device_id: ID of the device (Required)
:returns: None
"""
api = self._get_api(mds.SubscriptionsApi)
return api.delete_endpoint_subscriptions(device_id)
@catch_exceptions(mds.rest.ApiException)
def _delete_subscription(self, device_id, resource_path):
api = self._get_api(mds.SubscriptionsApi)
return api.delete_resource_subscription(device_id, resource_path)
@catch_exceptions(mds.rest.ApiException)
def delete_resource_subscription(self, device_id=None, resource_path=None, fix_path=True):
"""Unsubscribe from device and/or resource_path updates.
If device_id or resource_path is None, or this method is called without arguments,
all subscriptions are removed.
Calling it with only device_id removes subscriptions for all resources
on the given device.
:param device_id: device to unsubscribe events from. If not
provided, all registered devices will be unsubscribed.
:param resource_path: resource_path to unsubscribe events from. If not
provided, all resource paths will be unsubscribed.
:param fix_path: remove trailing / in resouce path to ensure API works.
:return: void
"""
devices = [_f for _f in [device_id] if _f]
if not device_id:
devices = list(self._queues.keys())
resource_paths = [resource_path]
if not resource_path:
resource_paths = []
for e in devices:
resource_paths.extend(list(self._queues[e].keys()))
# Delete the subscriptions
for e in devices:
for r in resource_paths:
# Fix the path, if required.
fixed_path = r
if fix_path and r.startswith("/"):
fixed_path = r[1:]
# Make request to API, ignoring result
self._delete_subscription(device_id, fixed_path)
# Remove Queue from dictionary
del self._queues[e][r]
return
def notify_webhook_received(self, payload):
"""Callback function for triggering notification channel handlers.
Use this in conjunction with a webserver to complete the loop when using
webhooks as the notification channel.
:param str payload: the encoded payload, as sent by the notification channel
"""
class PayloadContainer: # noqa
# bodge to give attribute lookup
data = payload
notification = self._get_api(mds.NotificationsApi).api_client.deserialize(
PayloadContainer, mds.NotificationMessage.__name__
)
handle_channel_message(
db=self._db,
queues=self._queues,
b64decode=self.b64decode,
notification_object=notification
)
@catch_exceptions(mds.rest.ApiException)
def get_webhook(self):
"""Get the current callback URL if it exists.
:return: The currently set webhook
"""
api = self._get_api(mds.NotificationsApi)
return Webhook(api.get_webhook())
@catch_exceptions(mds.rest.ApiException)
def update_webhook(self, url, headers=None):
"""Register new webhook for incoming subscriptions.
If a webhook is already set, this will do an overwrite.
:param str url: the URL with listening webhook (Required)
:param dict headers: K/V dict with additional headers to send with request
:return: void
"""
headers = headers or {}
api = self._get_api(mds.NotificationsApi)
# Delete notifications channel
api.delete_long_poll_channel()
# Send the request to register the webhook
webhook_obj = WebhookData(url=url, headers=headers)
api.register_webhook(webhook_obj)
return
@catch_exceptions(mds.rest.ApiException)
def delete_webhook(self):
"""Delete/remove registered webhook.
If no webhook is registered, an exception (404) will be raised.
Note that every registered subscription will be deleted as part of
deregistering a webhook.
:return: void
"""
api = self._get_api(mds.NotificationsApi)
api.deregister_webhook()
# Every subscription will be deleted, so we can clear the queues too.
self._queues.clear()
return
@catch_exceptions(statistics.rest.ApiException)
def list_metrics(self, include=None, interval="1d", **kwargs):
"""Get statistics.
:param list[str] include: List of fields included in response.
None, or an empty list will return all fields.
Fields: transactions, successful_api_calls, failed_api_calls, successful_handshakes,
pending_bootstraps, successful_bootstraps, failed_bootstraps, registrations,
updated_registrations, expired_registrations, deleted_registrations
:param str interval: Group data by this interval in days, weeks or hours.
Sample values: 2h, 3w, 4d.
:param datetime start: Fetch the data with timestamp greater than or equal to this value.
The parameter is not mandatory, if the period is specified.
:param datetime end: Fetch the data with timestamp less than this value.
The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in days, weeks or hours.
Sample values: 2h, 3w, 4d.
The parameter is not mandatory, if the start and end time are specified
:param int limit: The number of devices to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get metrics after/starting at given metric ID
:returns: a list of :py:class:`Metric` objects
:rtype: PaginatedResponse
"""
self._verify_arguments(interval, kwargs)
include = Metric._map_includes(include)
kwargs.update(dict(include=include, interval=interval))
api = self._get_api(statistics.StatisticsApi)
return PaginatedResponse(api.get_metrics, lwrap_type=Metric, **kwargs)
def _subscription_handler(self, queue, device_id, path, callback_fn):
while True:
value = queue.get()
callback_fn(device_id, path, value)
def _verify_arguments(self, interval, kwargs):
start = kwargs.get("start", None)
end = kwargs.get("end", None)
period = kwargs.get("period", None)
if not start and not end and not period:
raise CloudValueError(
"start and end is mandatory if period is not specified.")
if start and not end:
raise CloudValueError("end is required if start is specified.")
if end and not start:
raise CloudValueError("start is required if end is specified.")
pattern = re.compile("[0-9]+[h|d|w]$")
if period and not pattern.match(period):
raise CloudValueError(
"period is incorrect. Sample values: 2h, 3w, 4d.")
if interval and not pattern.match(interval):
raise CloudValueError(
"interval is incorrect. Sample values: 2h, 3w, 4d.")
# convert start into UTC RFC3339 format
if start:
kwargs['start'] = utils.force_utc(start, 'start', precision=3)
# convert end into UTC RFC3339 format
if end:
kwargs['end'] = utils.force_utc(end, 'end', precision=3)
|
class ConnectAPI(BaseAPI):
'''API reference for the Connect API.
Exposing functionality for doing a range of device related actions:
- Listing connected devices
- Exploring and managing resources and resource values on connected devices
- Setup resource subscriptions and webhooks for resource monitoring
'''
def __init__(self, params=None):
'''A module to access this section of the Pelion Device Management API.
:param params: Dictionary to override configuration values
: autostart_notification_thread : Automatically starts a thread
if needed for Async APIs (e.g. get_resource_value).
This should be set to False when using webhooks for notifications.
'''
pass
@property
def has_active_notification_thread(self):
'''Has active notification thread'''
pass
def ensure_notifications_thread(self):
'''Ensure notification thread is running'''
pass
def start_notifications(self):
'''Start the notifications thread.
If an external callback is not set up (using `update_webhook`) then
calling this function is mandatory to get or set resource.
.. code-block:: python
>>> api.start_notifications()
>>> print(api.get_resource_value(device, path))
Some value
>>> api.stop_notifications()
:returns: void
'''
pass
def stop_notifications(self):
'''Stop the notifications thread.
:returns:
'''
pass
@catch_exceptions(device_directory.rest.ApiException)
def list_connected_devices(self, **kwargs):
'''List connected devices.
Example usage, listing all registered devices in the catalog:
.. code-block:: python
filters = {
'created_at': {'$gte': datetime.datetime(2017,01,01),
'$lte': datetime.datetime(2017,12,31)
}
}
devices = api.list_connected_devices(order='asc', filters=filters)
for idx, device in enumerate(devices):
print(device)
## Other example filters
# Directly connected devices (not via gateways):
filters = {
'host_gateway': {'$eq': ''},
'device_type': {'$eq': ''}
}
# Devices connected via gateways:
filters = {
'host_gateway': {'$neq': ''}
}
# Gateway devices:
filters = {
'device_type': {'$eq': 'MBED_GW'}
}
:param int limit: The number of devices to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get devices after/starting at given `device_id`
:param filters: Dictionary of filters to apply.
:returns: a list of connected :py:class:`Device` objects.
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(mds.rest.ApiException)
def list_resources(self, device_id):
'''List all resources registered to a connected device.
.. code-block:: python
>>> for r in api.list_resources(device_id):
print(r.name, r.observable, r.uri)
None,True,/3/0/1
Update,False,/5/0/3
...
:param str device_id: The ID of the device (Required)
:returns: A list of :py:class:`Resource` objects for the device
:rtype: list
'''
pass
@catch_exceptions(mds.rest.ApiException)
def get_resource(self, device_id, resource_path):
'''Get a resource.
:param str device_id: ID of the device (Required)
:param str path: Path of the resource to get (Required)
:returns: Device resource
:rtype Resource
'''
pass
def _mds_rpc_post(self, device_id, _wrap_with_consumer=True, async_id=None, **params):
'''Helper for using RPC endpoint'''
pass
@catch_exceptions(mds.rest.ApiException)
def get_resource_value_async(self, device_id, resource_path, fix_path=True):
'''Get a resource value for a given device and resource path.
Will not block, but instead return an AsyncConsumer. Example usage:
.. code-block:: python
a = api.get_resource_value_async(device, path)
while not a.is_done:
time.sleep(0.1)
if a.error:
print("Error", a.error)
print("Current value", a.value)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to get (Required)
:param bool fix_path: strip leading / of path if present
:returns: Consumer object to control asynchronous request
:rtype: AsyncConsumer
'''
pass
@catch_exceptions(mds.rest.ApiException)
def get_resource_value_async(self, device_id, resource_path, fix_path=True):
'''Get a resource value for a given device and resource path by blocking thread.
Example usage:
.. code-block:: python
try:
v = api.get_resource_value(device_id, path)
print("Current value", v)
except CloudAsyncError, e:
print("Error", e)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to get (Required)
:param fix_path: if True then the leading /, if found, will be stripped before
doing request to backend. This is a requirement for the API to work properly
:param timeout: Seconds to request value for before timeout. If not provided, the
program might hang indefinitely.
:raises: CloudAsyncError, CloudTimeoutError
:returns: The resource value for the requested resource path
:rtype: str
'''
pass
@catch_exceptions(mds.rest.ApiException)
def set_resource_value(self, device_id, resource_path, resource_value,
fix_path=True, timeout=None):
'''Set resource value for given resource path, on device.
Will block and wait for response to come through. Usage:
.. code-block:: python
try:
v = api.set_resource_value(device, path, value)
print("Success, new value:", v)
except AsyncError, e:
print("Error", e)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param str resource_value: The new value to set for given path
:param fix_path: Unused
:param timeout: Timeout in seconds
:raises: AsyncError
:returns: The value of the new resource
:rtype: str
'''
pass
@staticmethod
def _base64_encode(resource_value):
'''Base64 encode the value in a Python version agnostic way.
Use encode and decode to covert to and from a bytes object which b64encode will encode.
'''
pass
@catch_exceptions(mds.rest.ApiException)
def set_resource_value_async(self, device_id, resource_path,
resource_value=None, fix_path=True):
'''Set resource value for given resource path, on device.
Will not block. Returns immediately. Usage:
.. code-block:: python
a = api.set_resource_value_async(device, path, value)
while not a.is_done:
time.sleep(0.1)
if a.error:
print("Error", a.error)
print("Success, new value:", a.value)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param str resource_value: The new value to set for given path
:param fix_path: Unused
:returns: An async consumer object holding reference to request
:rtype: AsyncConsumer
'''
pass
@catch_exceptions(mds.rest.ApiException)
def execute_resource(self, device_id, resource_path, fix_path=True, timeout=None):
'''Execute a function on a resource.
Will block and wait for response to come through. Usage:
.. code-block:: python
try:
v = api.execute_resource(device, path)
print("Success, returned value:", v)
except AsyncError, e:
print("Error", e)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param str resource_function: Unused
:param fix_path: Unused
:param timeout: Timeout in seconds
:raises: AsyncError
:returns: The value returned from the function executed on the resource
:rtype: str
'''
pass
@catch_exceptions(mds.rest.ApiException)
def execute_resource_async(self, device_id, resource_path, fix_path=True):
'''Execute a function on a resource.
Will not block. Returns immediately. Usage:
.. code-block:: python
a = api.execute_resource_async(device, path)
while not a.is_done:
time.sleep(0.1)
if a.error:
print("Error", a.error)
print("Success, returned value:", a.value)
:param str device_id: The name/id of the device (Required)
:param str resource_path: The resource path to update (Required)
:param fix_path: Unused
:returns: An async consumer object holding reference to request
:rtype: AsyncConsumer
'''
pass
@catch_exceptions(mds.rest.ApiException)
def _add_subscription(self, device_id, resource_path):
pass
@catch_exceptions(mds.rest.ApiException)
def add_resource_subscription(self, device_id, resource_path, fix_path=True, queue_size=5):
'''Subscribe to resource updates.
When called on a valid device and resource path a subscription is setup so that
any update on the resource path value triggers a new element on the FIFO queue.
The returned object is a native Python Queue object.
:param device_id: Name of device to subscribe on (Required)
:param resource_path: The resource path on device to observe (Required)
:param fix_path: Removes leading / on resource_path if found
:param queue_size: Sets the Queue size. If set to 0, no queue object will be created
:returns: a queue of resource updates
:rtype: Queue
'''
pass
@catch_exceptions(mds.rest.ApiException)
def add_resource_subscription_async(self, device_id, resource_path, callback_fn,
fix_path=True, queue_size=5):
'''Subscribe to resource updates with callback function.
When called on a valid device and resource path a subscription is setup so that
any update on the resource path value triggers an update on the callback function.
:param device_id: Name of device to set the subscription on (Required)
:param resource_path: The resource path on device to observe (Required)
:param callback_fn: Callback function to be executed on update to subscribed resource
:param fix_path: Removes leading / on resource_path if found
:param queue_size: Sets the Queue size. If set to 0, no queue object will be created
:returns: void
'''
pass
@catch_exceptions(mds.rest.ApiException)
def get_resource_subscription(self, device_id, resource_path, fix_path=True):
'''Read subscription status.
:param device_id: Name of device to set the subscription on (Required)
:param resource_path: The resource path on device to observe (Required)
:param fix_path: Removes leading / on resource_path if found
:returns: status of subscription
'''
pass
@catch_exceptions(mds.rest.ApiException)
def update_presubscriptions(self, presubscriptions):
'''Update pre-subscription data. Pre-subscription data will be removed for empty list.
:param presubscriptions: list of `Presubscription` objects (Required)
:returns: None
'''
pass
@catch_exceptions(mds.rest.ApiException)
def delete_presubscriptions(self):
'''Deletes pre-subscription data.
:returns: None
'''
pass
@catch_exceptions(mds.rest.ApiException)
def delete_subscriptions(self):
'''Remove all subscriptions.
Warning: This could be slow for large numbers of connected devices.
If possible, explicitly delete subscriptions known to have been created.
:returns: None
'''
pass
@catch_exceptions(mds.rest.ApiException)
def list_presubscriptions(self, **kwargs):
'''Get a list of pre-subscription data
:returns: a list of `Presubscription` objects
:rtype: list of mbed_cloud.presubscription.Presubscription
'''
pass
@catch_exceptions(mds.rest.ApiException)
def list_device_subscriptions(self, device_id, **kwargs):
'''Lists all subscribed resources from a single device
:param device_id: ID of the device (Required)
:returns: a list of subscribed resources
:rtype: list of str
'''
pass
@catch_exceptions(mds.rest.ApiException)
def delete_device_subscriptions(self, device_id):
'''Removes a device's subscriptions
:param device_id: ID of the device (Required)
:returns: None
'''
pass
@catch_exceptions(mds.rest.ApiException)
def _delete_subscription(self, device_id, resource_path):
pass
@catch_exceptions(mds.rest.ApiException)
def delete_resource_subscription(self, device_id=None, resource_path=None, fix_path=True):
'''Unsubscribe from device and/or resource_path updates.
If device_id or resource_path is None, or this method is called without arguments,
all subscriptions are removed.
Calling it with only device_id removes subscriptions for all resources
on the given device.
:param device_id: device to unsubscribe events from. If not
provided, all registered devices will be unsubscribed.
:param resource_path: resource_path to unsubscribe events from. If not
provided, all resource paths will be unsubscribed.
:param fix_path: remove trailing / in resouce path to ensure API works.
:return: void
'''
pass
def notify_webhook_received(self, payload):
'''Callback function for triggering notification channel handlers.
Use this in conjunction with a webserver to complete the loop when using
webhooks as the notification channel.
:param str payload: the encoded payload, as sent by the notification channel
'''
pass
class PayloadContainer:
@catch_exceptions(mds.rest.ApiException)
def get_webhook(self):
'''Get the current callback URL if it exists.
:return: The currently set webhook
'''
pass
@catch_exceptions(mds.rest.ApiException)
def update_webhook(self, url, headers=None):
'''Register new webhook for incoming subscriptions.
If a webhook is already set, this will do an overwrite.
:param str url: the URL with listening webhook (Required)
:param dict headers: K/V dict with additional headers to send with request
:return: void
'''
pass
@catch_exceptions(mds.rest.ApiException)
def delete_webhook(self):
'''Delete/remove registered webhook.
If no webhook is registered, an exception (404) will be raised.
Note that every registered subscription will be deleted as part of
deregistering a webhook.
:return: void
'''
pass
@catch_exceptions(statistics.rest.ApiException)
def list_metrics(self, include=None, interval="1d", **kwargs):
'''Get statistics.
:param list[str] include: List of fields included in response.
None, or an empty list will return all fields.
Fields: transactions, successful_api_calls, failed_api_calls, successful_handshakes,
pending_bootstraps, successful_bootstraps, failed_bootstraps, registrations,
updated_registrations, expired_registrations, deleted_registrations
:param str interval: Group data by this interval in days, weeks or hours.
Sample values: 2h, 3w, 4d.
:param datetime start: Fetch the data with timestamp greater than or equal to this value.
The parameter is not mandatory, if the period is specified.
:param datetime end: Fetch the data with timestamp less than this value.
The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in days, weeks or hours.
Sample values: 2h, 3w, 4d.
The parameter is not mandatory, if the start and end time are specified
:param int limit: The number of devices to retrieve
:param str order: The ordering direction, ascending (asc) or descending (desc)
:param str after: Get metrics after/starting at given metric ID
:returns: a list of :py:class:`Metric` objects
:rtype: PaginatedResponse
'''
pass
def _subscription_handler(self, queue, device_id, path, callback_fn):
pass
def _verify_arguments(self, interval, kwargs):
pass
| 64 | 32 | 18 | 2 | 7 | 9 | 2 | 1.08 | 1 | 27 | 20 | 0 | 34 | 6 | 35 | 42 | 707 | 123 | 281 | 123 | 214 | 304 | 209 | 91 | 172 | 8 | 2 | 3 | 69 |
2,515 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/connect/connect.py
|
mbed_cloud.connect.connect.ConnectAPI.notify_webhook_received.PayloadContainer
|
class PayloadContainer: # noqa
# bodge to give attribute lookup
data = payload
|
class PayloadContainer:
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 2 | 2 | 1 | 2 | 2 | 2 | 1 | 0 | 0 | 0 | 0 |
2,516 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/connect/notifications.py
|
mbed_cloud.connect.notifications.NotificationsThread
|
class NotificationsThread(threading.Thread):
"""A thread object"""
def __init__(self, db, queues, b64decode=True, notifications_api=None,
subscription_manager=None):
"""Stoppable thread"""
super(NotificationsThread, self).__init__()
self.db = db
self.queues = queues
self.notifications_api = notifications_api
self.subscription_manager = subscription_manager
self._b64decode = b64decode
self._stopping = False
self._stopped = threading.Event()
@catch_exceptions(mds.rest.ApiException)
@functools.wraps(threading.Thread.run)
def run(self):
"""Thread main loop"""
retries = 0
try:
while not self._stopping:
try:
data = self.notifications_api.long_poll_notifications()
except mds.rest.ApiException as e:
# An HTTP 410 can be raised when stopping so don't log anything
if not self._stopping:
backoff = 2 ** retries - \
random.randint(int(retries / 2), retries)
LOG.error(
'Notification long poll failed with exception (retry in %d seconds):\n%s', backoff, e)
retries += 1
# Backoff for an increasing amount of time until we have tried 10 times, then reset the backoff.
if retries >= 10:
retries = 0
time.sleep(backoff)
else:
handle_channel_message(
db=self.db,
queues=self.queues,
b64decode=self._b64decode,
notification_object=data
)
if self.subscription_manager:
self.subscription_manager.notify(data.to_dict())
finally:
self._stopped.set()
def stop(self):
"""Request thread stop"""
self._stopping = True
return self._stopped
|
class NotificationsThread(threading.Thread):
'''A thread object'''
def __init__(self, db, queues, b64decode=True, notifications_api=None,
subscription_manager=None):
'''Stoppable thread'''
pass
@catch_exceptions(mds.rest.ApiException)
@functools.wraps(threading.Thread.run)
def run(self):
'''Thread main loop'''
pass
def stop(self):
'''Request thread stop'''
pass
| 6 | 4 | 15 | 1 | 13 | 2 | 3 | 0.15 | 1 | 3 | 0 | 0 | 3 | 7 | 3 | 28 | 53 | 6 | 41 | 17 | 34 | 6 | 32 | 14 | 28 | 6 | 1 | 5 | 8 |
2,517 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/device_directory/device_directory.py
|
mbed_cloud.device_directory.device_directory.DeviceDirectoryAPI
|
class DeviceDirectoryAPI(BaseAPI):
"""API reference for the Device API.
Exposing functionality for doing a range of device related actions:
- Listing registered devices
- Create and manage device queries
"""
api_structure = {device_directory: [device_directory.DefaultApi]}
@catch_exceptions(DeviceDirectoryApiException)
def list_devices(self, **kwargs):
"""List devices in the device catalog.
Example usage, listing all registered devices in the catalog:
.. code-block:: python
filters = { 'state': {'$eq': 'registered' } }
devices = api.list_devices(order='asc', filters=filters)
for idx, d in enumerate(devices):
print(idx, d.id)
:param int limit: The number of devices to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get devices after/starting at given `device_id`
:param filters: Dictionary of filters to apply.
:returns: a list of :py:class:`Device` objects registered in the catalog.
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, Device, True)
api = self._get_api(device_directory.DefaultApi)
return PaginatedResponse(api.device_list, lwrap_type=Device, **kwargs)
@catch_exceptions(DeviceDirectoryApiException)
def get_device(self, device_id):
"""Get device details from catalog.
:param str device_id: the ID of the device to retrieve (Required)
:returns: device object matching the `device_id`.
:rtype: Device
"""
api = self._get_api(device_directory.DefaultApi)
return Device(api.device_retrieve(device_id))
@catch_exceptions(DeviceDirectoryApiException)
def update_device(self, device_id, **kwargs):
"""Update existing device in catalog.
.. code-block:: python
existing_device = api.get_device(...)
updated_device = api.update_device(
existing_device.id,
certificate_fingerprint = "something new"
)
:param str device_id: The ID of the device to update (Required)
:param obj custom_attributes: Up to 5 custom JSON attributes
:param str description: The description of the device
:param str name: The name of the device
:param str alias: The alias of the device
:param str device_type: The endpoint type of the device - e.g. if the device is a gateway
:param str host_gateway: The endpoint_name of the host gateway, if appropriate
:param str certificate_fingerprint: Fingerprint of the device certificate
:param str certificate_issuer_id: ID of the issuer of the certificate
:returns: the updated device object
:rtype: Device
"""
api = self._get_api(device_directory.DefaultApi)
device = Device._create_request_map(kwargs)
body = DeviceDataPostRequest(**device)
return Device(api.device_update(device_id, body))
@catch_exceptions(DeviceDirectoryApiException)
def add_device(self, **kwargs):
"""Add a new device to catalog.
.. code-block:: python
device = {
"mechanism": "connector",
"certificate_fingerprint": "<certificate>",
"name": "New device name",
"certificate_issuer_id": "<id>"
}
resp = api.add_device(**device)
print(resp.created_at)
:param str certificate_fingerprint: Fingerprint of the device certificate
:param str certificate_issuer_id: ID of the issuer of the certificate
:param str name: The name of the device
:param str account_id: The owning Identity and Access Managment (IAM) account ID
:param obj custom_attributes: Up to 5 custom JSON attributes
:param str description: The description of the device
:param str device_class: Class of the device
:param str id: The ID of the device
:param str manifest_url: URL for the current device manifest
:param str mechanism: The ID of the channel used to communicate with the device
:param str mechanism_url: The address of the connector to use
:param str serial_number: The serial number of the device
:param str state: The current state of the device
:param str vendor_id: The device vendor ID
:param str alias: The alias of the device
:param str device_type: The endpoint type of the device - e.g. if the device is a gateway
:param str host_gateway: The endpoint_name of the host gateway, if appropriate
:param datetime bootstrap_certificate_expiration:
:param datetime connector_certificate_expiration: Expiration date of the certificate
used to connect to connector server
:param int device_execution_mode: The device class
:param str firmware_checksum: The SHA256 checksum of the current firmware image
:param datetime manifest_timestamp: The timestamp of the current manifest version
:return: the newly created device object.
:rtype: Device
"""
api = self._get_api(device_directory.DefaultApi)
device = Device._create_request_map(kwargs)
device = DeviceData(**device)
return Device(api.device_create(device))
@catch_exceptions(DeviceDirectoryApiException)
def delete_device(self, device_id):
"""Delete device from catalog.
:param str device_id: ID of device in catalog to delete (Required)
:return: void
"""
api = self._get_api(device_directory.DefaultApi)
return api.device_destroy(id=device_id)
@catch_exceptions(DeviceDirectoryApiException)
def list_queries(self, **kwargs):
"""List queries in device query service.
:param int limit: The number of devices to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get devices after/starting at given `device_id`
:param filters: Dictionary of filters to apply.
:returns: a list of :py:class:`Query` objects.
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, Query, True)
api = self._get_api(device_directory.DefaultApi)
return PaginatedResponse(api.device_query_list, lwrap_type=Query, **kwargs)
@catch_exceptions(DeviceDirectoryApiException)
def add_query(self, name, filter, **kwargs):
"""Add a new query to device query service.
.. code-block:: python
f = api.add_query(
name = "Query name",
filter = {
"device_id": {"$eq": "01234"},
custom_attributes = {
"foo": {"$eq": "bar"}
}
}
)
print(f.created_at)
:param str name: Name of query
:param dict filter: Filter properties to apply (Required)
:return: The newly created query object.
:rtype: Query
"""
# Ensure we have the correct types and get the new query object
filter_obj = filters.legacy_filter_formatter(
dict(filter=filter),
Device._get_attributes_map()
) if filter else None
query_map = Query._create_request_map(kwargs)
# Create the DeviceQuery object
f = DeviceQuery(name=name, query=filter_obj['filter'], **query_map)
api = self._get_api(device_directory.DefaultApi)
return Query(api.device_query_create(f))
@catch_exceptions(DeviceDirectoryApiException)
def update_query(self, query_id, name=None, filter=None, **kwargs):
"""Update existing query in device query service.
.. code-block:: python
q = api.get_query(...)
q.filter["custom_attributes"]["foo"] = {
"$eq": "bar"
}
new_q = api.update_query(
query_id = q.id,
name = "new name",
filter = q.filter
)
:param str query_id: Existing query ID to update (Required)
:param str name: name of query
:param dict filter: query properties to apply
:return: the newly updated query object.
:rtype: Query
"""
# Get urlencoded query attribute
filter_obj = filters.legacy_filter_formatter(
dict(filter=filter),
Device._get_attributes_map()
) if filter else None
query_map = Query._create_request_map(kwargs)
# The filter option is optional on update but DeviceQueryPostPutRequest sets it None, which is invalid.
# Manually create a resource body without the filter parameter if only the name is provided.
if filter is None:
body = {"name": name}
else:
body = DeviceQueryPostPutRequest(
name=name, query=filter_obj['filter'], **query_map)
api = self._get_api(device_directory.DefaultApi)
return Query(api.device_query_update(query_id, body))
@catch_exceptions(DeviceDirectoryApiException)
def delete_query(self, query_id):
"""Delete query in device query service.
:param int query_id: ID of the query to delete (Required)
:return: void
"""
api = self._get_api(device_directory.DefaultApi)
api.device_query_destroy(query_id)
return
@catch_exceptions(DeviceDirectoryApiException)
def get_query(self, query_id):
"""Get query in device query service.
:param int query_id: ID of the query to get (Required)
:returns: device query object
:rtype: Query
"""
api = self._get_api(device_directory.DefaultApi)
return Query(api.device_query_retrieve(query_id))
@catch_exceptions(DeviceDirectoryApiException)
def list_device_events(self, **kwargs):
"""List all device logs.
:param int limit: The number of logs to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get logs after/starting at given `device_event_id`
:param dict filters: Dictionary of filters to apply.
:return: list of :py:class:`DeviceEvent` objects
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, DeviceEvent, True)
api = self._get_api(device_directory.DefaultApi)
return PaginatedResponse(api.device_log_list, lwrap_type=DeviceEvent, **kwargs)
@catch_exceptions(DeviceDirectoryApiException)
def get_device_event(self, device_event_id):
"""Get device event with provided ID.
:param int device_event_id: id of the event to get (Required)
:rtype: DeviceEvent
"""
api = self._get_api(device_directory.DefaultApi)
return DeviceEvent(api.device_log_retrieve(device_event_id))
|
class DeviceDirectoryAPI(BaseAPI):
'''API reference for the Device API.
Exposing functionality for doing a range of device related actions:
- Listing registered devices
- Create and manage device queries
'''
@catch_exceptions(DeviceDirectoryApiException)
def list_devices(self, **kwargs):
'''List devices in the device catalog.
Example usage, listing all registered devices in the catalog:
.. code-block:: python
filters = { 'state': {'$eq': 'registered' } }
devices = api.list_devices(order='asc', filters=filters)
for idx, d in enumerate(devices):
print(idx, d.id)
:param int limit: The number of devices to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get devices after/starting at given `device_id`
:param filters: Dictionary of filters to apply.
:returns: a list of :py:class:`Device` objects registered in the catalog.
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def get_device(self, device_id):
'''Get device details from catalog.
:param str device_id: the ID of the device to retrieve (Required)
:returns: device object matching the `device_id`.
:rtype: Device
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def update_device(self, device_id, **kwargs):
'''Update existing device in catalog.
.. code-block:: python
existing_device = api.get_device(...)
updated_device = api.update_device(
existing_device.id,
certificate_fingerprint = "something new"
)
:param str device_id: The ID of the device to update (Required)
:param obj custom_attributes: Up to 5 custom JSON attributes
:param str description: The description of the device
:param str name: The name of the device
:param str alias: The alias of the device
:param str device_type: The endpoint type of the device - e.g. if the device is a gateway
:param str host_gateway: The endpoint_name of the host gateway, if appropriate
:param str certificate_fingerprint: Fingerprint of the device certificate
:param str certificate_issuer_id: ID of the issuer of the certificate
:returns: the updated device object
:rtype: Device
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def add_device(self, **kwargs):
'''Add a new device to catalog.
.. code-block:: python
device = {
"mechanism": "connector",
"certificate_fingerprint": "<certificate>",
"name": "New device name",
"certificate_issuer_id": "<id>"
}
resp = api.add_device(**device)
print(resp.created_at)
:param str certificate_fingerprint: Fingerprint of the device certificate
:param str certificate_issuer_id: ID of the issuer of the certificate
:param str name: The name of the device
:param str account_id: The owning Identity and Access Managment (IAM) account ID
:param obj custom_attributes: Up to 5 custom JSON attributes
:param str description: The description of the device
:param str device_class: Class of the device
:param str id: The ID of the device
:param str manifest_url: URL for the current device manifest
:param str mechanism: The ID of the channel used to communicate with the device
:param str mechanism_url: The address of the connector to use
:param str serial_number: The serial number of the device
:param str state: The current state of the device
:param str vendor_id: The device vendor ID
:param str alias: The alias of the device
:param str device_type: The endpoint type of the device - e.g. if the device is a gateway
:param str host_gateway: The endpoint_name of the host gateway, if appropriate
:param datetime bootstrap_certificate_expiration:
:param datetime connector_certificate_expiration: Expiration date of the certificate
used to connect to connector server
:param int device_execution_mode: The device class
:param str firmware_checksum: The SHA256 checksum of the current firmware image
:param datetime manifest_timestamp: The timestamp of the current manifest version
:return: the newly created device object.
:rtype: Device
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def delete_device(self, device_id):
'''Delete device from catalog.
:param str device_id: ID of device in catalog to delete (Required)
:return: void
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def list_queries(self, **kwargs):
'''List queries in device query service.
:param int limit: The number of devices to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get devices after/starting at given `device_id`
:param filters: Dictionary of filters to apply.
:returns: a list of :py:class:`Query` objects.
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def add_query(self, name, filter, **kwargs):
'''Add a new query to device query service.
.. code-block:: python
f = api.add_query(
name = "Query name",
filter = {
"device_id": {"$eq": "01234"},
custom_attributes = {
"foo": {"$eq": "bar"}
}
}
)
print(f.created_at)
:param str name: Name of query
:param dict filter: Filter properties to apply (Required)
:return: The newly created query object.
:rtype: Query
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def update_query(self, query_id, name=None, filter=None, **kwargs):
'''Update existing query in device query service.
.. code-block:: python
q = api.get_query(...)
q.filter["custom_attributes"]["foo"] = {
"$eq": "bar"
}
new_q = api.update_query(
query_id = q.id,
name = "new name",
filter = q.filter
)
:param str query_id: Existing query ID to update (Required)
:param str name: name of query
:param dict filter: query properties to apply
:return: the newly updated query object.
:rtype: Query
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def delete_query(self, query_id):
'''Delete query in device query service.
:param int query_id: ID of the query to delete (Required)
:return: void
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def get_query(self, query_id):
'''Get query in device query service.
:param int query_id: ID of the query to get (Required)
:returns: device query object
:rtype: Query
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def list_device_events(self, **kwargs):
'''List all device logs.
:param int limit: The number of logs to retrieve.
:param str order: The ordering direction, ascending (asc) or
descending (desc)
:param str after: Get logs after/starting at given `device_event_id`
:param dict filters: Dictionary of filters to apply.
:return: list of :py:class:`DeviceEvent` objects
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(DeviceDirectoryApiException)
def get_device_event(self, device_event_id):
'''Get device event with provided ID.
:param int device_event_id: id of the event to get (Required)
:rtype: DeviceEvent
'''
pass
| 25 | 13 | 20 | 2 | 5 | 12 | 1 | 2.03 | 1 | 10 | 9 | 0 | 12 | 0 | 12 | 19 | 271 | 41 | 76 | 47 | 51 | 154 | 57 | 35 | 44 | 3 | 2 | 1 | 15 |
2,518 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/enrollment/enrollment.py
|
mbed_cloud.enrollment.enrollment.EnrollmentAPI
|
class EnrollmentAPI(BaseAPI):
"""API reference for the Enrollment API."""
api_structure = {enrollment: [enrollment.PublicAPIApi]}
@catch_exceptions(EnrollmentAPIException)
def add_enrollment_claim(self, **kwargs):
"""Add"""
api = self._get_api(enrollment.PublicAPIApi)
item = EnrollmentClaim._create_request_map(kwargs)
item = models.EnrollmentIdentity(**item)
return EnrollmentClaim(api.create_device_enrollment(item))
@catch_exceptions(EnrollmentAPIException)
def get_enrollment_claim(self, id, **kwargs):
"""Get"""
api = self._get_api(enrollment.PublicAPIApi)
return EnrollmentClaim(api.get_device_enrollment(id=id))
@catch_exceptions(EnrollmentAPIException)
def list_enrollment_claims(self, **kwargs):
"""List"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, EnrollmentClaim)
api = self._get_api(enrollment.PublicAPIApi)
return PaginatedResponse(
api.get_device_enrollments,
lwrap_type=EnrollmentClaim,
**kwargs
)
@catch_exceptions(EnrollmentAPIException)
def delete_enrollment_claim(self, id, **kwargs):
"""Delete"""
api = self._get_api(enrollment.PublicAPIApi)
return api.delete_device_enrollment(id=id)
@catch_exceptions(EnrollmentAPIException)
def bulk_add_enrollment_claim(self, datafile):
"""Bulk upload
With bulk upload you can upload a CSV file containing a number of enrollment IDs.
First line of the CSV is read as a header and not as an enrollment identity.
:returns: BulkCreateResponse
"""
api = self._get_api(enrollment.PublicAPIApi)
return api.create_bulk_device_enrollment(enrollment_identities=datafile)
@catch_exceptions(EnrollmentAPIException)
def get_bulk_add_enrollment_claim_status(self, bulk_id):
"""Get status of bulk upload
Provides info about bulk upload for the given ID.
For example bulk status and processed count of enrollment identities.
:returns: BulkCreateResponse
"""
api = self._get_api(enrollment.PublicAPIApi)
return api.get_bulk_device_enrollment(id=bulk_id)
|
class EnrollmentAPI(BaseAPI):
'''API reference for the Enrollment API.'''
@catch_exceptions(EnrollmentAPIException)
def add_enrollment_claim(self, **kwargs):
'''Add'''
pass
@catch_exceptions(EnrollmentAPIException)
def get_enrollment_claim(self, id, **kwargs):
'''Get'''
pass
@catch_exceptions(EnrollmentAPIException)
def list_enrollment_claims(self, **kwargs):
'''List'''
pass
@catch_exceptions(EnrollmentAPIException)
def delete_enrollment_claim(self, id, **kwargs):
'''Delete'''
pass
@catch_exceptions(EnrollmentAPIException)
def bulk_add_enrollment_claim(self, datafile):
'''Bulk upload
With bulk upload you can upload a CSV file containing a number of enrollment IDs.
First line of the CSV is read as a header and not as an enrollment identity.
:returns: BulkCreateResponse
'''
pass
@catch_exceptions(EnrollmentAPIException)
def get_bulk_add_enrollment_claim_status(self, bulk_id):
'''Get status of bulk upload
Provides info about bulk upload for the given ID.
For example bulk status and processed count of enrollment identities.
:returns: BulkCreateResponse
'''
pass
| 13 | 7 | 7 | 1 | 4 | 2 | 1 | 0.44 | 1 | 4 | 4 | 0 | 6 | 0 | 6 | 13 | 60 | 11 | 34 | 21 | 21 | 15 | 24 | 15 | 17 | 1 | 2 | 0 | 6 |
2,519 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/update/update.py
|
mbed_cloud.update.update.UpdateAPI
|
class UpdateAPI(BaseAPI):
"""Describing the public update API.
Exposing functionality from the following underlying services:
- Update service
- Update campaigns
- Manifest management
"""
api_structure = {update_service: [update_service.DefaultApi]}
@catch_exceptions(UpdateServiceApiException)
def list_campaigns(self, **kwargs):
"""List all update campaigns.
:param int limit: number of campaigns to retrieve
:param str order: sort direction of campaigns when ordered by creation time (desc|asc)
:param str after: get campaigns after given campaign ID
:param dict filters: Dictionary of filters to apply
:return: List of :py:class:`Campaign` objects
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, Campaign, True)
api = self._get_api(update_service.DefaultApi)
return PaginatedResponse(api.update_campaign_list, lwrap_type=Campaign, **kwargs)
@catch_exceptions(UpdateServiceApiException)
def get_campaign(self, campaign_id):
"""Get existing update campaign.
:param str campaign_id: Campaign ID to retrieve (Required)
:return: Update campaign object matching provided ID
:rtype: Campaign
"""
api = self._get_api(update_service.DefaultApi)
return Campaign(api.update_campaign_retrieve(campaign_id))
@catch_exceptions(UpdateServiceApiException)
def add_campaign(self, name, device_filter, **kwargs):
"""Add new update campaign.
Add an update campaign with a name and device filtering. Example:
.. code-block:: python
device_api, update_api = DeviceDirectoryAPI(), UpdateAPI()
# Get a filter to use for update campaign
query_obj = device_api.get_query(query_id="MYID")
# Create the campaign
new_campaign = update_api.add_campaign(
name="foo",
device_filter=query_obj.filter
)
:param str name: Name of the update campaign (Required)
:param str device_filter: The device filter to use (Required)
:param str manifest_id: ID of the manifest with description of the update
:param str description: Description of the campaign
:param int scheduled_at: The timestamp at which update campaign is scheduled to start
:param str state: The state of the campaign. Values:
"draft", "scheduled", "devicefetch", "devicecopy", "publishing",
"deploying", "deployed", "manifestremoved", "expired"
:return: newly created campaign object
:rtype: Campaign
"""
device_filter = filters.legacy_filter_formatter(
dict(filter=device_filter),
Device._get_attributes_map()
)
campaign = Campaign._create_request_map(kwargs)
if 'when' in campaign:
campaign['when'] = force_utc(campaign['when'])
body = UpdateCampaignPostRequest(
name=name,
device_filter=device_filter['filter'],
**campaign)
api = self._get_api(update_service.DefaultApi)
return Campaign(api.update_campaign_create(body))
@catch_exceptions(UpdateServiceApiException)
def start_campaign(self, campaign_object):
"""Start a draft update campaign.
:param Campaign campaign_object: Campaign object to schedule for immediate start (Required)
:return: newly edited campaign object
:rtype: Campaign
"""
campaign_object._state = "scheduled"
return self.update_campaign(campaign_object)
@catch_exceptions(UpdateServiceApiException)
def update_campaign(self, campaign_object=None, campaign_id=None, **kwargs):
"""Update an update campaign.
:param :class:`Campaign` campaign_object: Campaign object to update (Required)
:return: updated campaign object
:rtype: Campaign
"""
api = self._get_api(update_service.DefaultApi)
if campaign_object:
campaign_id = campaign_object.id
campaign_object = campaign_object._create_patch_request()
else:
campaign_object = Campaign._create_request_map(kwargs)
if 'device_filter' in campaign_object:
campaign_object["device_filter"] = filters.legacy_filter_formatter(
dict(filter=campaign_object["device_filter"]),
Device._get_attributes_map()
)['filter']
if 'when' in campaign_object:
campaign_object['when'] = force_utc(campaign_object['when'])
return Campaign(api.update_campaign_update(campaign_id=campaign_id,
campaign=campaign_object))
@catch_exceptions(UpdateServiceApiException)
def delete_campaign(self, campaign_id):
"""Delete an update campaign.
:param str campaign_id: Campaign ID to delete (Required)
:return: void
"""
api = self._get_api(update_service.DefaultApi)
api.update_campaign_destroy(campaign_id)
return
@catch_exceptions(UpdateServiceApiException)
def list_campaign_device_states(self, campaign_id, **kwargs):
"""List campaign devices status.
:param str campaign_id: Id of the update campaign (Required)
:param int limit: number of devices state to retrieve
:param str order: sort direction of device state when ordered by creation time (desc|asc)
:param str after: get devices state after given id
:return: List of :py:class:`CampaignDeviceState` objects
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, CampaignDeviceState, True)
kwargs["campaign_id"] = campaign_id
api = self._get_api(update_service.DefaultApi)
return PaginatedResponse(api.update_campaign_metadata_list,
lwrap_type=CampaignDeviceState, **kwargs)
@catch_exceptions(UpdateServiceApiException)
def get_firmware_image(self, image_id):
"""Get a firmware image with provided image_id.
:param str image_id: The firmware ID for the image to retrieve (Required)
:return: FirmwareImage
"""
api = self._get_api(update_service.DefaultApi)
return FirmwareImage(api.firmware_image_retrieve(image_id))
@catch_exceptions(UpdateServiceApiException)
def list_firmware_images(self, **kwargs):
"""List all firmware images.
:param int limit: number of firmware images to retrieve
:param str order: ordering of images when ordered by time. 'desc' or 'asc'
:param str after: get firmware images after given `image_id`
:param dict filters: Dictionary of filters to apply
:return: list of :py:class:`FirmwareImage` objects
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, FirmwareImage, True)
api = self._get_api(update_service.DefaultApi)
return PaginatedResponse(api.firmware_image_list, lwrap_type=FirmwareImage, **kwargs)
@catch_exceptions(UpdateServiceApiException)
def add_firmware_image(self, name, datafile, **kwargs):
"""Add a new firmware reference.
:param str name: Firmware file short name (Required)
:param str datafile: The file object or *path* to the firmware image file (Required)
:param str description: Firmware file description
:return: the newly created firmware file object
:rtype: FirmwareImage
"""
kwargs.update({'name': name})
firmware_image = FirmwareImage._create_request_map(kwargs)
firmware_image.update({'datafile': datafile})
api = self._get_api(update_service.DefaultApi)
return FirmwareImage(
api.firmware_image_create(**firmware_image)
)
@catch_exceptions(UpdateServiceApiException)
def delete_firmware_image(self, image_id):
"""Delete a firmware image.
:param str image_id: image ID for the firmware to remove/delete (Required)
:return: void
"""
api = self._get_api(update_service.DefaultApi)
api.firmware_image_destroy(image_id=image_id)
return
@catch_exceptions(UpdateServiceApiException)
def get_firmware_manifest(self, manifest_id):
"""Get manifest with provided manifest_id.
:param str manifest_id: ID of manifest to retrieve (Required)
:return: FirmwareManifest
"""
api = self._get_api(update_service.DefaultApi)
return FirmwareManifest(api.firmware_manifest_retrieve(manifest_id=manifest_id))
@catch_exceptions(UpdateServiceApiException)
def list_firmware_manifests(self, **kwargs):
"""List all manifests.
:param int limit: number of manifests to retrieve
:param str order: sort direction of manifests when ordered by time. 'desc' or 'asc'
:param str after: get manifests after given `image_id`
:param dict filters: Dictionary of filters to apply
:return: list of :py:class:`FirmwareManifest` objects
:rtype: PaginatedResponse
"""
kwargs = self._verify_sort_options(kwargs)
kwargs = self._verify_filters(kwargs, FirmwareManifest, True)
api = self._get_api(update_service.DefaultApi)
return PaginatedResponse(api.firmware_manifest_list, lwrap_type=FirmwareManifest, **kwargs)
@catch_exceptions(UpdateServiceApiException)
def add_firmware_manifest(self, name, datafile, key_table_file=None, **kwargs):
"""Add a new manifest reference.
:param str name: Manifest file short name (Required)
:param str datafile: The file object or path to the manifest file (Required)
:param str key_table_file: The file object or path to the key_table file (Optional)
:param str description: Manifest file description
:return: the newly created manifest file object
:rtype: FirmwareManifest
"""
kwargs.update({
'name': name,
'url': datafile, # really it's the datafile
})
if key_table_file is not None:
# really it's the key_table
kwargs.update({'key_table_url': key_table_file})
firmware_manifest = FirmwareManifest._create_request_map(kwargs)
api = self._get_api(update_service.DefaultApi)
return FirmwareManifest(
api.firmware_manifest_create(**firmware_manifest)
)
@catch_exceptions(UpdateServiceApiException)
def delete_firmware_manifest(self, manifest_id):
"""Delete an existing manifest.
:param str manifest_id: Manifest file ID to delete (Required)
:return: void
"""
api = self._get_api(update_service.DefaultApi)
return api.firmware_manifest_destroy(manifest_id)
|
class UpdateAPI(BaseAPI):
'''Describing the public update API.
Exposing functionality from the following underlying services:
- Update service
- Update campaigns
- Manifest management
'''
@catch_exceptions(UpdateServiceApiException)
def list_campaigns(self, **kwargs):
'''List all update campaigns.
:param int limit: number of campaigns to retrieve
:param str order: sort direction of campaigns when ordered by creation time (desc|asc)
:param str after: get campaigns after given campaign ID
:param dict filters: Dictionary of filters to apply
:return: List of :py:class:`Campaign` objects
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(UpdateServiceApiException)
def get_campaign(self, campaign_id):
'''Get existing update campaign.
:param str campaign_id: Campaign ID to retrieve (Required)
:return: Update campaign object matching provided ID
:rtype: Campaign
'''
pass
@catch_exceptions(UpdateServiceApiException)
def add_campaign(self, name, device_filter, **kwargs):
'''Add new update campaign.
Add an update campaign with a name and device filtering. Example:
.. code-block:: python
device_api, update_api = DeviceDirectoryAPI(), UpdateAPI()
# Get a filter to use for update campaign
query_obj = device_api.get_query(query_id="MYID")
# Create the campaign
new_campaign = update_api.add_campaign(
name="foo",
device_filter=query_obj.filter
)
:param str name: Name of the update campaign (Required)
:param str device_filter: The device filter to use (Required)
:param str manifest_id: ID of the manifest with description of the update
:param str description: Description of the campaign
:param int scheduled_at: The timestamp at which update campaign is scheduled to start
:param str state: The state of the campaign. Values:
"draft", "scheduled", "devicefetch", "devicecopy", "publishing",
"deploying", "deployed", "manifestremoved", "expired"
:return: newly created campaign object
:rtype: Campaign
'''
pass
@catch_exceptions(UpdateServiceApiException)
def start_campaign(self, campaign_object):
'''Start a draft update campaign.
:param Campaign campaign_object: Campaign object to schedule for immediate start (Required)
:return: newly edited campaign object
:rtype: Campaign
'''
pass
@catch_exceptions(UpdateServiceApiException)
def update_campaign(self, campaign_object=None, campaign_id=None, **kwargs):
'''Update an update campaign.
:param :class:`Campaign` campaign_object: Campaign object to update (Required)
:return: updated campaign object
:rtype: Campaign
'''
pass
@catch_exceptions(UpdateServiceApiException)
def delete_campaign(self, campaign_id):
'''Delete an update campaign.
:param str campaign_id: Campaign ID to delete (Required)
:return: void
'''
pass
@catch_exceptions(UpdateServiceApiException)
def list_campaign_device_states(self, campaign_id, **kwargs):
'''List campaign devices status.
:param str campaign_id: Id of the update campaign (Required)
:param int limit: number of devices state to retrieve
:param str order: sort direction of device state when ordered by creation time (desc|asc)
:param str after: get devices state after given id
:return: List of :py:class:`CampaignDeviceState` objects
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(UpdateServiceApiException)
def get_firmware_image(self, image_id):
'''Get a firmware image with provided image_id.
:param str image_id: The firmware ID for the image to retrieve (Required)
:return: FirmwareImage
'''
pass
@catch_exceptions(UpdateServiceApiException)
def list_firmware_images(self, **kwargs):
'''List all firmware images.
:param int limit: number of firmware images to retrieve
:param str order: ordering of images when ordered by time. 'desc' or 'asc'
:param str after: get firmware images after given `image_id`
:param dict filters: Dictionary of filters to apply
:return: list of :py:class:`FirmwareImage` objects
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(UpdateServiceApiException)
def add_firmware_image(self, name, datafile, **kwargs):
'''Add a new firmware reference.
:param str name: Firmware file short name (Required)
:param str datafile: The file object or *path* to the firmware image file (Required)
:param str description: Firmware file description
:return: the newly created firmware file object
:rtype: FirmwareImage
'''
pass
@catch_exceptions(UpdateServiceApiException)
def delete_firmware_image(self, image_id):
'''Delete a firmware image.
:param str image_id: image ID for the firmware to remove/delete (Required)
:return: void
'''
pass
@catch_exceptions(UpdateServiceApiException)
def get_firmware_manifest(self, manifest_id):
'''Get manifest with provided manifest_id.
:param str manifest_id: ID of manifest to retrieve (Required)
:return: FirmwareManifest
'''
pass
@catch_exceptions(UpdateServiceApiException)
def list_firmware_manifests(self, **kwargs):
'''List all manifests.
:param int limit: number of manifests to retrieve
:param str order: sort direction of manifests when ordered by time. 'desc' or 'asc'
:param str after: get manifests after given `image_id`
:param dict filters: Dictionary of filters to apply
:return: list of :py:class:`FirmwareManifest` objects
:rtype: PaginatedResponse
'''
pass
@catch_exceptions(UpdateServiceApiException)
def add_firmware_manifest(self, name, datafile, key_table_file=None, **kwargs):
'''Add a new manifest reference.
:param str name: Manifest file short name (Required)
:param str datafile: The file object or path to the manifest file (Required)
:param str key_table_file: The file object or path to the key_table file (Optional)
:param str description: Manifest file description
:return: the newly created manifest file object
:rtype: FirmwareManifest
'''
pass
@catch_exceptions(UpdateServiceApiException)
def delete_firmware_manifest(self, manifest_id):
'''Delete an existing manifest.
:param str manifest_id: Manifest file ID to delete (Required)
:return: void
'''
pass
| 31 | 16 | 15 | 1 | 6 | 7 | 1 | 1 | 1 | 9 | 8 | 0 | 15 | 0 | 15 | 22 | 260 | 38 | 112 | 50 | 81 | 112 | 78 | 35 | 62 | 4 | 2 | 1 | 20 |
2,520 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/tests/integration/examples/test_examples.py
|
tests.integration.examples.test_examples.TestExamples
|
class TestExamples(BaseCase):
@unittest.skip('cannot demonstrate pip in test suite')
def test_install(self):
"""
# an example: initial setup
pip install mbed-cloud-sdk
# end of example
"""
pass
def test_legacy_listing_resources(self):
# an example: legacy listing resources
from mbed_cloud import BillingAPI
billing_api = BillingAPI()
for quota_history in billing_api.get_quota_history():
print("Quota change reason: %s, delta: %s" %
(quota_history.reason, quota_history.delta))
# end of example
def test_legacy_get_resources(self):
# an example: legacy get resource
from mbed_cloud import BillingAPI
billing_api = BillingAPI()
print("Quota remaining: %s" % billing_api.get_quota_remaining())
# end of example
def test_configuration(self):
with self.assertRaises(CloudApiException):
# an example: configuring the SDK
from mbed_cloud import AccountManagementAPI
config = dict(api_key='ak_1234abc')
# alternatively, configuration can be loaded from json files or environment variables
# if the host is not the default Pelion Device Management, it needs to be specified
config['host'] = 'https://custom-mbed-cloud-host.com'
# create an instance of one of the SDK modules
api = AccountManagementAPI(params=config)
# do something with the SDK
print(api.get_account())
# end of example
def test_list_connected(self):
# an example: list devices in Pelion Device Management
from mbed_cloud import ConnectAPI
api = ConnectAPI()
# Print all devices
for device in api.list_connected_devices(order='asc', max_results=900):
print(device.id, device.state)
# end of example
def test_list_disconnected(self):
# an example: list deregistered devices in Pelion Device Management
from mbed_cloud import DeviceDirectoryAPI
api = DeviceDirectoryAPI()
# Print all devices
for device in api.list_devices(filter=dict(state='deregistered'), order='asc', max_results=900):
print(device.id, device.state)
# end of example
def test_subscribe_resources(self):
import logging
logging.basicConfig(level=logging.DEBUG)
# an example: subscribing to resource value changes
# creates an Observer listening to resource value changes for devices
# whose id starts with `016` and resource paths start with `/3/0/`
from mbed_cloud import ConnectAPI
api = ConnectAPI()
# prepare a channel
channel = api.subscribe.channels.ResourceValues(
device_id='016*', resource_path='/3/0/*')
# start listening for updates
observer = api.subscribe(channel)
# on the first update for the channel, block for the specified timeout
print(observer.next().block(timeout=120000))
# end of example
def test_subscribe_device_state(self):
# an example: subscribing to device state changes
# creates an Observer listening to device state changes for devices
# whose id starts with `016`
from mbed_cloud import ConnectAPI
api = ConnectAPI()
# prepare a channel
channel = api.subscribe.channels.DeviceStateChanges(
device_id='016*',
# here, `channel` refers to the filterable device state received from
# the notification system
channel=[
api.subscribe.channels.ChannelIdentifiers.registrations,
api.subscribe.channels.ChannelIdentifiers.registrations_expired
]
)
# start listening for updates
observer = api.subscribe(channel)
# on the first update for the channel, block for the specified timeout
print(observer.next().block(timeout=120000))
|
class TestExamples(BaseCase):
@unittest.skip('cannot demonstrate pip in test suite')
def test_install(self):
'''
# an example: initial setup
pip install mbed-cloud-sdk
# end of example
'''
pass
def test_legacy_listing_resources(self):
pass
def test_legacy_get_resources(self):
pass
def test_configuration(self):
pass
def test_list_connected(self):
pass
def test_list_disconnected(self):
pass
def test_subscribe_resources(self):
pass
def test_subscribe_device_state(self):
pass
| 10 | 1 | 10 | 1 | 6 | 4 | 1 | 0.72 | 1 | 6 | 5 | 0 | 8 | 0 | 8 | 80 | 98 | 12 | 50 | 33 | 32 | 36 | 43 | 32 | 26 | 2 | 3 | 1 | 11 |
2,521 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/tests/unit/asynchronous/test_subscribers.py
|
tests.unit.asynchronous.test_subscribers.TestSubscriptions
|
class TestSubscriptions(BaseCase):
def test_subscribe(self):
subs = SubscriptionsManager(mock.MagicMock())
observer_a = subs.subscribe(channels.DeviceStateChanges(device_id='A'))
observer_b = subs.subscribe(channels.DeviceStateChanges(device_id='B'))
observer_c = subs.subscribe(channels.DeviceStateChanges())
self.assertIsNot(observer_a, observer_b)
self.assertIsNot(observer_b, observer_c)
future_a = observer_a.next().defer()
future_b = observer_b.next().defer()
future_c = observer_c.next().defer()
self.assertIsNot(future_a, future_b)
self.assertIsNot(future_b, future_c)
# a valid, but irrelevant channel
subs.notify({
channels.ChannelIdentifiers.async_responses: [
dict(a=1, b=2, device_id='A')
]
})
time.sleep(0.01)
self.assertFalse(future_a.ready())
self.assertFalse(future_b.ready())
self.assertFalse(future_c.ready())
# a valid channel, relevant for DeviceState
subs.notify({
channels.ChannelIdentifiers.reg_updates: [
dict(ep='A', original_ep='test_original_ep')
]
})
result = future_a.get(timeout=2)
self.assertDictContainsSubset(
dict(device_id="A", alias="test_original_ep"), result)
# just because one observer (`a`) is ready, does not mean another (`c`) is.
result = future_c.get(timeout=2)
self.assertDictContainsSubset(
dict(device_id="A", alias="test_original_ep"), result)
self.assertFalse(future_b.ready())
def test_subscribe_custom_threadpool(self):
subs = SubscriptionsManager(mock.MagicMock())
custom_threads = ThreadPool(processes=1)
observer_a = subs.subscribe(
channels.DeviceStateChanges(device_id='A'),
provider=custom_threads
)
with mock.patch.object(custom_threads, 'apply_async') as custom:
observer_a.next().defer()
observer_a.next().defer()
# prove that we used the threadpool we provided
self.assertEqual(custom_threads.apply_async.call_count, 2)
def test_notify_registration_expiry(self):
subs = SubscriptionsManager(mock.MagicMock())
observer = subs.subscribe(channels.DeviceStateChanges())
future = observer.next().defer()
subs.notify({
channels.ChannelIdentifiers.registrations_expired: [
"device_id_test"
]
})
output = future.get(timeout=2)
self.assertEqual(
output, {"device_id": "device_id_test", "channel": "registrations_expired"})
def test_notify_de_registrations(self):
subs = SubscriptionsManager(mock.MagicMock())
observer = subs.subscribe(channels.DeviceStateChanges())
future = observer.next().defer()
subs.notify({
channels.ChannelIdentifiers.de_registrations: [
"device_id_test"
]
})
output = future.get(timeout=2)
self.assertEqual(
output, {"device_id": "device_id_test", "channel": "de_registrations"})
def test_notify_registration(self):
subs = SubscriptionsManager(mock.MagicMock())
observer = subs.subscribe(channels.DeviceStateChanges())
future = observer.next().defer()
subs.notify({
channels.ChannelIdentifiers.registrations: [
{
"ep": "test_endpoint_name",
"original_ep": "test_original_ep",
"ept": "test_ept",
"q": "test_q",
"resources": [{
"path": "test_path",
"if": "test_if",
"rt": "test_rt",
"ct": "test_ct",
"obs": "test_obs"
}]
}
]
})
output = future.get(timeout=2)
self.assertEqual(output, {
"channel": "registrations",
"device_id": "test_endpoint_name",
"alias": "test_original_ep",
"device_type": "test_ept",
"queue_mode": "test_q",
"resources": [{
"path": "test_path",
"type": "test_rt",
"content_type": "test_ct",
"observable": "test_obs"
}]
})
def test_notify_reg_updates(self):
subs = SubscriptionsManager(mock.MagicMock())
observer = subs.subscribe(channels.DeviceStateChanges())
future = observer.next().defer()
subs.notify({
channels.ChannelIdentifiers.reg_updates: [
{
"ep": "test_endpoint_name",
"original_ep": "test_original_ep",
"ept": "test_ept",
"q": "test_q",
"resources": [{
"path": "test_path",
"if": "test_if",
"rt": "test_rt",
"ct": "test_ct",
"obs": "test_obs"
}]
}
]
})
output = future.get(timeout=2)
self.assertEqual(output, {
"channel": "reg_updates",
"device_id": "test_endpoint_name",
"alias": "test_original_ep",
"device_type": "test_ept",
"queue_mode": "test_q",
"resources": [{
"path": "test_path",
"type": "test_rt",
"content_type": "test_ct",
"observable": "test_obs"
}]
})
@unittest.skipIf(os.environ.get('CI'), 'Do not run in CI')
def test_live_create_and_cleanup(self):
# integration - ResourceValueCurrent cleans up
from mbed_cloud.connect import ConnectAPI
api = ConnectAPI()
d = api.list_connected_devices().first()
r = api.subscribe(api.subscribe.channels.ResourceValues(
device_id=d.id,
resource_path='/3/0/0',
)).next().block(timeout=2)
self.assertTrue(r)
# wait for notifications to be stopped
api.stop_notifications()
# check that the routing table is cleaned up
for i in range(10):
time.sleep(0.01)
if not api.subscribe.list_all():
break
else:
self.fail('Routing table not empty')
@BaseCase._skip_in_ci
def test_live_device_state_change(self):
# integration - DeviceStateChanges local filter
from mbed_cloud.connect import ConnectAPI
api = ConnectAPI()
d = api.list_connected_devices().first()
observer = api.subscribe(
api.subscribe.channels.DeviceStateChanges(device_id=d.id))
# cheat, waiting takes too long
api.subscribe.notify({
channels.ChannelIdentifiers.reg_updates: [
dict(a=1, b=2, ep=d.id),
dict(a=1, b=2, ep='A'),
dict(a=1, b=2, ep='B'),
]
})
r = observer.next().block(timeout=2)
self.assertTrue(r)
@unittest.skipIf(os.environ.get('CI'), 'Do not run in CI')
def test_registration_notifications(self):
"""Test a all registration notifications in a single message"""
from mbed_cloud.connect import ConnectAPI
device_id = "015f3850a657000000000001001002ab"
api = ConnectAPI()
registrations_observer = api.subscribe(api.subscribe.channels.DeviceStateChanges(
device_id=device_id,
channel=channels.ChannelIdentifiers.registrations),
provider=False)
de_registrations_observer = api.subscribe(api.subscribe.channels.DeviceStateChanges(
device_id=device_id,
channel=channels.ChannelIdentifiers.de_registrations))
reg_updates_observer = api.subscribe(api.subscribe.channels.DeviceStateChanges(
device_id=device_id,
channel=channels.ChannelIdentifiers.reg_updates))
registrations_expired_observer = api.subscribe(api.subscribe.channels.DeviceStateChanges(
device_id=device_id,
channel=channels.ChannelIdentifiers.registrations_expired))
# cheat, waiting takes too long
example_data = {
"registrations": [{
"q": False,
"original-ep": "my-device-123",
"ept": "Light",
"resources": [{
"path": "/sen/light",
"ct": "text/plain",
"obs": True,
"rt": "light_sensor",
"if": "sensor"
}],
"ep": device_id
}],
"reg_updates": [{
"q": False,
"original-ep": "my-device-123",
"ept": "Light",
"resources": [{
"path": "/sen/light",
"ct": "text/plain",
"obs": True,
"rt": "light_sensor",
"if": "sensor"
}],
"ep": device_id
}],
"async_responses": [{
"ct": "text/plain",
"payload": "My4zMQ==",
"max-age": "60",
"id": "9e3c96b8-c4d7-496a-ab90-cc732b9b560e",
"error": "TIMEOUT",
"status": 200
}],
"notifications": [{
"path": "/sen/light",
"ct": "text/plain",
"payload": "My4zMQ==",
"max-age": "60",
"ep": device_id
}],
"de_registrations": [device_id],
"registrations_expired": [device_id],
}
api.subscribe.notify(example_data)
self.assertEqual(registrations_observer.next().block(timeout=2),
{
'alias': None,
'channel': 'registrations',
'device_id': '015f3850a657000000000001001002ab',
'device_type': 'Light',
'queue_mode': False,
'resources': [{'content_type': 'text/plain',
'observable': True,
'path': '/sen/light',
'type': 'light_sensor'}]})
self.assertEqual(de_registrations_observer.next().block(timeout=2),
{'channel': 'de_registrations', 'device_id': '015f3850a657000000000001001002ab'})
self.assertEqual(reg_updates_observer.next().block(timeout=2),
{'alias': None,
'channel': 'reg_updates',
'device_id': '015f3850a657000000000001001002ab',
'device_type': 'Light',
'queue_mode': False,
'resources': [{'content_type': 'text/plain',
'observable': True,
'path': '/sen/light',
'type': 'light_sensor'}]})
self.assertEqual(registrations_expired_observer.next().block(timeout=2),
{'channel': 'registrations_expired',
'device_id': '015f3850a657000000000001001002ab'})
@unittest.skipIf(os.environ.get('CI'), 'Do not run in CI')
def test_observer_timeout(self):
"""Test that the observer timeouts"""
from mbed_cloud.connect import ConnectAPI
api = ConnectAPI()
observer = api.subscribe(
api.subscribe.channels.DeviceStateChanges(device_id=123456))
with self.assertRaises(CloudTimeoutError) as timeout_error:
observer.next().block(timeout=2)
self.assertEqual(str(timeout_error.exception),
"No data received after 2.0 seconds.")
|
class TestSubscriptions(BaseCase):
def test_subscribe(self):
pass
def test_subscribe_custom_threadpool(self):
pass
def test_notify_registration_expiry(self):
pass
def test_notify_de_registrations(self):
pass
def test_notify_registration_expiry(self):
pass
def test_notify_reg_updates(self):
pass
@unittest.skipIf(os.environ.get('CI'), 'Do not run in CI')
def test_live_create_and_cleanup(self):
pass
@BaseCase._skip_in_ci
def test_live_device_state_change(self):
pass
@unittest.skipIf(os.environ.get('CI'), 'Do not run in CI')
def test_registration_notifications(self):
'''Test a all registration notifications in a single message'''
pass
@unittest.skipIf(os.environ.get('CI'), 'Do not run in CI')
def test_observer_timeout(self):
'''Test that the observer timeouts'''
pass
| 15 | 2 | 29 | 2 | 26 | 1 | 1 | 0.05 | 1 | 9 | 5 | 0 | 10 | 0 | 10 | 82 | 308 | 31 | 265 | 65 | 246 | 12 | 102 | 59 | 87 | 3 | 3 | 2 | 12 |
2,522 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/api_client.py
|
mbed_cloud._backends.update_service.api_client.ApiClient
|
class ApiClient(object):
"""
Generic API client for Swagger client library builds.
Swagger generic API client. This client handles the client-
server communication, and is invariant across implementations. Specifics of
the methods and models for each application are generated from the Swagger
templates.
NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
:param configuration: .Configuration object for this client
:param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to
the API.
:param cookie: a cookie to include in the header when making calls
to the API
"""
PRIMITIVE_TYPES = (float, bool, bytes, text_type) + integer_types
NATIVE_TYPES_MAPPING = {
'int': int,
'long': int if PY3 else long,
'float': float,
'str': str,
'bool': bool,
'date': date,
'datetime': datetime,
'object': object,
}
def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None):
if configuration is None:
configuration = Configuration()
self.configuration = configuration
self.pool = ThreadPool()
self.rest_client = RESTClientObject(configuration)
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Swagger-Codegen/1.0.0/python'
# Change
# Store last api call metadata
self.last_metadata = {}
# End Change
def __del__(self):
self.pool.close()
self.pool.join()
@property
def user_agent(self):
"""User agent for this API client"""
return self.default_headers['User-Agent']
@user_agent.setter
def user_agent(self, value):
self.default_headers['User-Agent'] = value
def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
# Change
def metadata_wrapper(fn):
"""Save metadata of last api call."""
@functools.wraps(fn)
def wrapped_f(self, *args, **kwargs):
self.last_metadata = {}
self.last_metadata["url"] = self.configuration.host + args[0]
self.last_metadata["method"] = args[1]
self.last_metadata["timestamp"] = time.time()
try:
return fn(self, *args, **kwargs)
except Exception as e:
self.last_metadata["exception"] = e
raise
return wrapped_f
def get_last_metadata(self):
return self.last_metadata
# End Change
@metadata_wrapper
def __call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True,
_request_timeout=None):
config = self.configuration
# header parameters
header_params = header_params or {}
header_params.update(self.default_headers)
if self.cookie:
header_params['Cookie'] = self.cookie
if header_params:
header_params = self.sanitize_for_serialization(header_params)
header_params = dict(self.parameters_to_tuples(header_params,
collection_formats))
# path parameters
if path_params:
path_params = self.sanitize_for_serialization(path_params)
path_params = self.parameters_to_tuples(path_params,
collection_formats)
for k, v in path_params:
# specified safe chars, encode everything
resource_path = resource_path.replace(
'{%s}' % k, quote(str(v), safe=config.safe_chars_for_path_param))
# query parameters
if query_params:
query_params = self.sanitize_for_serialization(query_params)
query_params = self.parameters_to_tuples(query_params,
collection_formats)
# post parameters
if post_params or files:
post_params = self.prepare_post_parameters(post_params, files)
post_params = self.sanitize_for_serialization(post_params)
post_params = self.parameters_to_tuples(post_params,
collection_formats)
# auth setting
self.update_params_for_auth(header_params, query_params, auth_settings)
# body
if body:
body = self.sanitize_for_serialization(body)
# request url
url = self.configuration.host + resource_path
# perform request and return response
response_data = self.request(method, url,
query_params=query_params,
headers=header_params,
post_params=post_params, body=body,
_preload_content=_preload_content,
_request_timeout=_request_timeout)
self.last_response = response_data
return_data = response_data
if _preload_content:
# deserialize response data
if response_type:
return_data = self.deserialize(response_data, response_type)
else:
return_data = None
# Change
self.last_metadata["response"] = response_data
self.last_metadata["return_data"] = return_data
# End Change
if _return_http_data_only:
return (return_data)
else:
return (return_data, response_data.status, response_data.getheaders())
def sanitize_for_serialization(self, obj):
"""
Builds a JSON POST object.
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is swagger model, return the properties dict.
:param obj: The data to serialize.
:return: The serialized form of data.
"""
if obj is None:
return None
elif isinstance(obj, self.PRIMITIVE_TYPES):
return obj
elif isinstance(obj, list):
return [self.sanitize_for_serialization(sub_obj)
for sub_obj in obj]
elif isinstance(obj, tuple):
return tuple(self.sanitize_for_serialization(sub_obj)
for sub_obj in obj)
elif isinstance(obj, (datetime, date)):
return obj.isoformat()
if isinstance(obj, dict):
obj_dict = obj
else:
# Convert model obj to dict except
# attributes `swagger_types`, `attribute_map`
# and attributes which value is not None.
# Convert attribute name to json key in
# model definition for request.
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
for attr, _ in iteritems(obj.swagger_types)
if getattr(obj, attr) is not None}
return {key: self.sanitize_for_serialization(val)
for key, val in iteritems(obj_dict)}
def deserialize(self, response, response_type):
"""
Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
:param response_type: class literal for
deserialized object, or string of class name.
:return: deserialized object.
"""
# handle file downloading
# save response body into a tmp file and return the instance
if response_type == "file":
return self.__deserialize_file(response)
# fetch data from response object
try:
data = json.loads(response.data)
except ValueError:
data = response.data
return self.__deserialize(data, response_type)
def __deserialize(self, data, klass):
"""
Deserializes dict, list, str into an object.
:param data: dict, list or str.
:param klass: class literal, or string of class name.
:return: object.
"""
if data is None:
return None
if type(klass) == str:
if klass.startswith('list['):
sub_kls = re.match('list\[(.*)\]', klass).group(1)
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
if klass.startswith('dict('):
sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in iteritems(data)}
# convert str to class
if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass]
else:
klass = getattr(models, klass)
if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass)
elif klass == object:
return self.__deserialize_object(data)
elif klass == date:
return self.__deserialize_date(data)
elif klass == datetime:
return self.__deserialize_datatime(data)
else:
return self.__deserialize_model(data, klass)
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, asynchronous=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True,
_request_timeout=None):
"""
Makes the HTTP request (synchronous) and return the deserialized data.
To make an async request, set the asynchronous parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param asynchronous bool: execute request asynchronously
:param _return_http_data_only: response data without head status code and headers
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without
reading/decoding response data. Default is True.
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request
timeout. It can also be a pair (tuple) of (connection, read) timeouts.
:return:
If asynchronous parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter asynchronous is False or missing,
then the method will return the response directly.
"""
if not asynchronous:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
response_type, auth_settings,
_return_http_data_only, collection_formats, _preload_content, _request_timeout)
else:
thread = self.pool.apply_async(self.__call_api, (resource_path, method,
path_params, query_params,
header_params, body,
post_params, files,
response_type, auth_settings,
_return_http_data_only,
collection_formats, _preload_content, _request_timeout))
return thread
def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True, _request_timeout=None):
"""
Makes the HTTP request using RESTClient.
"""
if method == "GET":
return self.rest_client.GET(url,
query_params=query_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
headers=headers)
elif method == "HEAD":
return self.rest_client.HEAD(url,
query_params=query_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
headers=headers)
elif method == "OPTIONS":
return self.rest_client.OPTIONS(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "POST":
return self.rest_client.POST(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "PUT":
return self.rest_client.PUT(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "PATCH":
return self.rest_client.PATCH(url,
query_params=query_params,
headers=headers,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
elif method == "DELETE":
return self.rest_client.DELETE(url,
query_params=query_params,
headers=headers,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
else:
raise ValueError(
"http method must be `GET`, `HEAD`, `OPTIONS`,"
" `POST`, `PATCH`, `PUT` or `DELETE`."
)
def parameters_to_tuples(self, params, collection_formats):
"""
Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples
:param dict collection_formats: Parameter collection formats
:return: Parameters as list of tuples, collections formatted
"""
new_params = []
if collection_formats is None:
collection_formats = {}
for k, v in iteritems(params) if isinstance(params, dict) else params:
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
new_params.extend((k, value) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '
elif collection_format == 'tsv':
delimiter = '\t'
elif collection_format == 'pipes':
delimiter = '|'
else: # csv is the default
delimiter = ','
new_params.append(
(k, delimiter.join(str(value) for value in v)))
else:
new_params.append((k, v))
return new_params
# Change
def prepare_post_parameters(self, post_params=None, files=None):
"""
Builds form parameters.
:param post_params: Normal form parameters.
:param files: File parameters.
:return: Form parameters with files.
"""
params = post_params or []
for key, values in (files or {}).items():
for maybe_file_or_path in values if isinstance(values, list) else [values]:
try:
# use the parameter as if it was an open file object
data = maybe_file_or_path.read()
maybe_file_or_path = maybe_file_or_path.name
except AttributeError:
# then it is presumably a file path
with open(maybe_file_or_path, 'rb') as fh:
data = fh.read()
basepath = os.path.basename(maybe_file_or_path)
mimetype = mimetypes.guess_type(
basepath)[0] or 'application/octet-stream'
params.append((key, (basepath, data, mimetype)))
return params
# End Change
def select_header_accept(self, accepts):
"""
Returns `Accept` based on an array of accepts provided.
:param accepts: List of headers.
:return: Accept (e.g. application/json).
"""
if not accepts:
return
accepts = [x.lower() for x in accepts]
if 'application/json' in accepts:
return 'application/json'
else:
return ', '.join(accepts)
def select_header_content_type(self, content_types):
"""
Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types.
:return: Content-Type (e.g. application/json).
"""
if not content_types:
return 'application/json'
content_types = [x.lower() for x in content_types]
if 'application/json' in content_types or '*/*' in content_types:
return 'application/json'
else:
return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings):
"""
Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
"""
if not auth_settings:
return
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
if not auth_setting['value']:
continue
elif auth_setting['in'] == 'header':
headers[auth_setting['key']] = auth_setting['value']
elif auth_setting['in'] == 'query':
querys.append((auth_setting['key'], auth_setting['value']))
else:
raise ValueError(
'Authentication token must be in `query` or `header`'
)
def __deserialize_file(self, response):
"""
Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided.
:param response: RESTResponse.
:return: file path.
"""
fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
os.close(fd)
os.remove(path)
content_disposition = response.getheader("Content-Disposition")
if content_disposition:
filename = re.\
search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).\
group(1)
path = os.path.join(os.path.dirname(path), filename)
with open(path, "w") as f:
f.write(response.data)
return path
def __deserialize_primitive(self, data, klass):
"""
Deserializes string to primitive type.
:param data: str.
:param klass: class literal.
:return: int, long, float, str, bool.
"""
try:
return klass(data)
except UnicodeEncodeError:
return unicode(data)
except TypeError:
return data
def __deserialize_object(self, value):
"""
Return a original value.
:return: object.
"""
return value
def __deserialize_date(self, string):
"""
Deserializes string to date.
:param string: str.
:return: date.
"""
try:
from dateutil.parser import parse
return parse(string).date()
except ImportError:
return string
except ValueError:
raise ApiException(
status=0,
reason="Failed to parse `{0}` into a date object".format(
string)
)
def __deserialize_datatime(self, string):
"""
Deserializes string to datetime.
The string should be in iso8601 datetime format.
:param string: str.
:return: datetime.
"""
try:
from dateutil.parser import parse
return parse(string)
except ImportError:
return string
except ValueError:
raise ApiException(
status=0,
reason=(
"Failed to parse `{0}` into a datetime object"
.format(string)
)
)
def __deserialize_model(self, data, klass):
"""
Deserializes list or dict to model.
:param data: dict, list.
:param klass: class literal.
:return: model object.
"""
if not klass.swagger_types and not hasattr(klass, 'get_real_child_model'):
return data
kwargs = {}
if klass.swagger_types is not None:
for attr, attr_type in iteritems(klass.swagger_types):
if data is not None \
and klass.attribute_map[attr] in data \
and isinstance(data, (list, dict)):
value = data[klass.attribute_map[attr]]
kwargs[attr] = self.__deserialize(value, attr_type)
instance = klass(**kwargs)
if hasattr(instance, 'get_real_child_model'):
klass_name = instance.get_real_child_model(data)
if klass_name:
instance = self.__deserialize(data, klass_name)
return instance
|
class ApiClient(object):
'''
Generic API client for Swagger client library builds.
Swagger generic API client. This client handles the client-
server communication, and is invariant across implementations. Specifics of
the methods and models for each application are generated from the Swagger
templates.
NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
:param configuration: .Configuration object for this client
:param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to
the API.
:param cookie: a cookie to include in the header when making calls
to the API
'''
def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None):
pass
def __del__(self):
pass
@property
def user_agent(self):
'''User agent for this API client'''
pass
@user_agent.setter
def user_agent(self):
pass
def set_default_header(self, header_name, header_value):
pass
def metadata_wrapper(fn):
'''Save metadata of last api call.'''
pass
@functools.wraps(fn)
def wrapped_f(self, *args, **kwargs):
pass
def get_last_metadata(self):
pass
@metadata_wrapper
def __call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True,
_request_timeout=None):
pass
def sanitize_for_serialization(self, obj):
'''
Builds a JSON POST object.
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is swagger model, return the properties dict.
:param obj: The data to serialize.
:return: The serialized form of data.
'''
pass
def deserialize(self, response, response_type):
'''
Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
:param response_type: class literal for
deserialized object, or string of class name.
:return: deserialized object.
'''
pass
def __deserialize(self, data, klass):
'''
Deserializes dict, list, str into an object.
:param data: dict, list or str.
:param klass: class literal, or string of class name.
:return: object.
'''
pass
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, asynchronous=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True,
_request_timeout=None):
'''
Makes the HTTP request (synchronous) and return the deserialized data.
To make an async request, set the asynchronous parameter.
:param resource_path: Path to method endpoint.
:param method: Method to call.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param asynchronous bool: execute request asynchronously
:param _return_http_data_only: response data without head status code and headers
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without
reading/decoding response data. Default is True.
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request
timeout. It can also be a pair (tuple) of (connection, read) timeouts.
:return:
If asynchronous parameter is True,
the request will be called asynchronously.
The method will return the request thread.
If parameter asynchronous is False or missing,
then the method will return the response directly.
'''
pass
def request(self, method, url, query_params=None, headers=None,
post_params=None, body=None, _preload_content=True, _request_timeout=None):
'''
Makes the HTTP request using RESTClient.
'''
pass
def parameters_to_tuples(self, params, collection_formats):
'''
Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples
:param dict collection_formats: Parameter collection formats
:return: Parameters as list of tuples, collections formatted
'''
pass
def prepare_post_parameters(self, post_params=None, files=None):
'''
Builds form parameters.
:param post_params: Normal form parameters.
:param files: File parameters.
:return: Form parameters with files.
'''
pass
def select_header_accept(self, accepts):
'''
Returns `Accept` based on an array of accepts provided.
:param accepts: List of headers.
:return: Accept (e.g. application/json).
'''
pass
def select_header_content_type(self, content_types):
'''
Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types.
:return: Content-Type (e.g. application/json).
'''
pass
def update_params_for_auth(self, headers, querys, auth_settings):
'''
Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
'''
pass
def __deserialize_file(self, response):
'''
Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided.
:param response: RESTResponse.
:return: file path.
'''
pass
def __deserialize_primitive(self, data, klass):
'''
Deserializes string to primitive type.
:param data: str.
:param klass: class literal.
:return: int, long, float, str, bool.
'''
pass
def __deserialize_object(self, value):
'''
Return a original value.
:return: object.
'''
pass
def __deserialize_date(self, string):
'''
Deserializes string to date.
:param string: str.
:return: date.
'''
pass
def __deserialize_datatime(self, string):
'''
Deserializes string to datetime.
The string should be in iso8601 datetime format.
:param string: str.
:return: datetime.
'''
pass
def __deserialize_model(self, data, klass):
'''
Deserializes list or dict to model.
:param data: dict, list.
:param klass: class literal.
:return: model object.
'''
pass
| 30 | 19 | 23 | 2 | 15 | 6 | 4 | 0.46 | 1 | 17 | 3 | 0 | 24 | 7 | 24 | 24 | 625 | 84 | 372 | 85 | 329 | 170 | 235 | 66 | 207 | 11 | 1 | 4 | 98 |
2,523 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/tests/unit/test_config.py
|
tests.unit.test_config.TestConfigObj.test_logging.FakeLogHandler
|
class FakeLogHandler(Handler):
def emit(self, record):
q.put(record)
|
class FakeLogHandler(Handler):
def emit(self, record):
pass
| 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 21 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
2,524 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/update_campaign_eq_neq_filter.py
|
mbed_cloud._backends.update_service.models.update_campaign_eq_neq_filter.UpdateCampaignEqNeqFilter
|
class UpdateCampaignEqNeqFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'description': 'str',
'device_filter': 'str',
'etag': 'datetime',
'finished': 'datetime',
'id': 'str',
'name': 'str',
'root_manifest_id': 'str',
'started_at': 'datetime',
'state': 'str',
'updated_at': 'datetime',
'when': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'description': 'description',
'device_filter': 'device_filter',
'etag': 'etag',
'finished': 'finished',
'id': 'id',
'name': 'name',
'root_manifest_id': 'root_manifest_id',
'started_at': 'started_at',
'state': 'state',
'updated_at': 'updated_at',
'when': 'when'
}
def __init__(self, created_at=None, description=None, device_filter=None, etag=None, finished=None, id=None, name=None, root_manifest_id=None, started_at=None, state=None, updated_at=None, when=None):
"""
UpdateCampaignEqNeqFilter - a model defined in Swagger
"""
self._created_at = created_at
self._description = description
self._device_filter = device_filter
self._etag = etag
self._finished = finished
self._id = id
self._name = name
self._root_manifest_id = root_manifest_id
self._started_at = started_at
self._state = state
self._updated_at = updated_at
self._when = when
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this UpdateCampaignEqNeqFilter.
:return: The created_at of this UpdateCampaignEqNeqFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this UpdateCampaignEqNeqFilter.
:param created_at: The created_at of this UpdateCampaignEqNeqFilter.
:type: datetime
"""
self._created_at = created_at
@property
def description(self):
"""
Gets the description of this UpdateCampaignEqNeqFilter.
:return: The description of this UpdateCampaignEqNeqFilter.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this UpdateCampaignEqNeqFilter.
:param description: The description of this UpdateCampaignEqNeqFilter.
:type: str
"""
self._description = description
@property
def device_filter(self):
"""
Gets the device_filter of this UpdateCampaignEqNeqFilter.
:return: The device_filter of this UpdateCampaignEqNeqFilter.
:rtype: str
"""
return self._device_filter
@device_filter.setter
def device_filter(self, device_filter):
"""
Sets the device_filter of this UpdateCampaignEqNeqFilter.
:param device_filter: The device_filter of this UpdateCampaignEqNeqFilter.
:type: str
"""
self._device_filter = device_filter
@property
def etag(self):
"""
Gets the etag of this UpdateCampaignEqNeqFilter.
:return: The etag of this UpdateCampaignEqNeqFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this UpdateCampaignEqNeqFilter.
:param etag: The etag of this UpdateCampaignEqNeqFilter.
:type: datetime
"""
self._etag = etag
@property
def finished(self):
"""
Gets the finished of this UpdateCampaignEqNeqFilter.
:return: The finished of this UpdateCampaignEqNeqFilter.
:rtype: datetime
"""
return self._finished
@finished.setter
def finished(self, finished):
"""
Sets the finished of this UpdateCampaignEqNeqFilter.
:param finished: The finished of this UpdateCampaignEqNeqFilter.
:type: datetime
"""
self._finished = finished
@property
def id(self):
"""
Gets the id of this UpdateCampaignEqNeqFilter.
:return: The id of this UpdateCampaignEqNeqFilter.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this UpdateCampaignEqNeqFilter.
:param id: The id of this UpdateCampaignEqNeqFilter.
:type: str
"""
self._id = id
@property
def name(self):
"""
Gets the name of this UpdateCampaignEqNeqFilter.
:return: The name of this UpdateCampaignEqNeqFilter.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this UpdateCampaignEqNeqFilter.
:param name: The name of this UpdateCampaignEqNeqFilter.
:type: str
"""
self._name = name
@property
def root_manifest_id(self):
"""
Gets the root_manifest_id of this UpdateCampaignEqNeqFilter.
:return: The root_manifest_id of this UpdateCampaignEqNeqFilter.
:rtype: str
"""
return self._root_manifest_id
@root_manifest_id.setter
def root_manifest_id(self, root_manifest_id):
"""
Sets the root_manifest_id of this UpdateCampaignEqNeqFilter.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignEqNeqFilter.
:type: str
"""
self._root_manifest_id = root_manifest_id
@property
def started_at(self):
"""
Gets the started_at of this UpdateCampaignEqNeqFilter.
:return: The started_at of this UpdateCampaignEqNeqFilter.
:rtype: datetime
"""
return self._started_at
@started_at.setter
def started_at(self, started_at):
"""
Sets the started_at of this UpdateCampaignEqNeqFilter.
:param started_at: The started_at of this UpdateCampaignEqNeqFilter.
:type: datetime
"""
self._started_at = started_at
@property
def state(self):
"""
Gets the state of this UpdateCampaignEqNeqFilter.
:return: The state of this UpdateCampaignEqNeqFilter.
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""
Sets the state of this UpdateCampaignEqNeqFilter.
:param state: The state of this UpdateCampaignEqNeqFilter.
:type: str
"""
self._state = state
@property
def updated_at(self):
"""
Gets the updated_at of this UpdateCampaignEqNeqFilter.
:return: The updated_at of this UpdateCampaignEqNeqFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this UpdateCampaignEqNeqFilter.
:param updated_at: The updated_at of this UpdateCampaignEqNeqFilter.
:type: datetime
"""
self._updated_at = updated_at
@property
def when(self):
"""
Gets the when of this UpdateCampaignEqNeqFilter.
:return: The when of this UpdateCampaignEqNeqFilter.
:rtype: datetime
"""
return self._when
@when.setter
def when(self, when):
"""
Sets the when of this UpdateCampaignEqNeqFilter.
:param when: The when of this UpdateCampaignEqNeqFilter.
:type: datetime
"""
self._when = when
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdateCampaignEqNeqFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdateCampaignEqNeqFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, description=None, device_filter=None, etag=None, finished=None, id=None, name=None, root_manifest_id=None, started_at=None, state=None, updated_at=None, when=None):
'''
UpdateCampaignEqNeqFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this UpdateCampaignEqNeqFilter.
:return: The created_at of this UpdateCampaignEqNeqFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this UpdateCampaignEqNeqFilter.
:param created_at: The created_at of this UpdateCampaignEqNeqFilter.
:type: datetime
'''
pass
@property
def description(self):
'''
Gets the description of this UpdateCampaignEqNeqFilter.
:return: The description of this UpdateCampaignEqNeqFilter.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this UpdateCampaignEqNeqFilter.
:param description: The description of this UpdateCampaignEqNeqFilter.
:type: str
'''
pass
@property
def device_filter(self):
'''
Gets the device_filter of this UpdateCampaignEqNeqFilter.
:return: The device_filter of this UpdateCampaignEqNeqFilter.
:rtype: str
'''
pass
@device_filter.setter
def device_filter(self):
'''
Sets the device_filter of this UpdateCampaignEqNeqFilter.
:param device_filter: The device_filter of this UpdateCampaignEqNeqFilter.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this UpdateCampaignEqNeqFilter.
:return: The etag of this UpdateCampaignEqNeqFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this UpdateCampaignEqNeqFilter.
:param etag: The etag of this UpdateCampaignEqNeqFilter.
:type: datetime
'''
pass
@property
def finished(self):
'''
Gets the finished of this UpdateCampaignEqNeqFilter.
:return: The finished of this UpdateCampaignEqNeqFilter.
:rtype: datetime
'''
pass
@finished.setter
def finished(self):
'''
Sets the finished of this UpdateCampaignEqNeqFilter.
:param finished: The finished of this UpdateCampaignEqNeqFilter.
:type: datetime
'''
pass
@property
def id(self):
'''
Gets the id of this UpdateCampaignEqNeqFilter.
:return: The id of this UpdateCampaignEqNeqFilter.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this UpdateCampaignEqNeqFilter.
:param id: The id of this UpdateCampaignEqNeqFilter.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this UpdateCampaignEqNeqFilter.
:return: The name of this UpdateCampaignEqNeqFilter.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this UpdateCampaignEqNeqFilter.
:param name: The name of this UpdateCampaignEqNeqFilter.
:type: str
'''
pass
@property
def root_manifest_id(self):
'''
Gets the root_manifest_id of this UpdateCampaignEqNeqFilter.
:return: The root_manifest_id of this UpdateCampaignEqNeqFilter.
:rtype: str
'''
pass
@root_manifest_id.setter
def root_manifest_id(self):
'''
Sets the root_manifest_id of this UpdateCampaignEqNeqFilter.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignEqNeqFilter.
:type: str
'''
pass
@property
def started_at(self):
'''
Gets the started_at of this UpdateCampaignEqNeqFilter.
:return: The started_at of this UpdateCampaignEqNeqFilter.
:rtype: datetime
'''
pass
@started_at.setter
def started_at(self):
'''
Sets the started_at of this UpdateCampaignEqNeqFilter.
:param started_at: The started_at of this UpdateCampaignEqNeqFilter.
:type: datetime
'''
pass
@property
def state(self):
'''
Gets the state of this UpdateCampaignEqNeqFilter.
:return: The state of this UpdateCampaignEqNeqFilter.
:rtype: str
'''
pass
@state.setter
def state(self):
'''
Sets the state of this UpdateCampaignEqNeqFilter.
:param state: The state of this UpdateCampaignEqNeqFilter.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this UpdateCampaignEqNeqFilter.
:return: The updated_at of this UpdateCampaignEqNeqFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this UpdateCampaignEqNeqFilter.
:param updated_at: The updated_at of this UpdateCampaignEqNeqFilter.
:type: datetime
'''
pass
@property
def when(self):
'''
Gets the when of this UpdateCampaignEqNeqFilter.
:return: The when of this UpdateCampaignEqNeqFilter.
:rtype: datetime
'''
pass
@when.setter
def when(self):
'''
Sets the when of this UpdateCampaignEqNeqFilter.
:param when: The when of this UpdateCampaignEqNeqFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 55 | 31 | 9 | 1 | 3 | 5 | 1 | 1.03 | 1 | 3 | 0 | 0 | 30 | 13 | 30 | 30 | 367 | 73 | 145 | 73 | 90 | 149 | 85 | 49 | 54 | 5 | 1 | 2 | 35 |
2,525 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/update_campaign_in_nin_filter.py
|
mbed_cloud._backends.update_service.models.update_campaign_in_nin_filter.UpdateCampaignInNinFilter
|
class UpdateCampaignInNinFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'description': 'str',
'device_filter': 'str',
'etag': 'datetime',
'finished': 'datetime',
'id': 'str',
'name': 'str',
'root_manifest_id': 'str',
'started_at': 'datetime',
'state': 'str',
'updated_at': 'datetime',
'when': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'description': 'description',
'device_filter': 'device_filter',
'etag': 'etag',
'finished': 'finished',
'id': 'id',
'name': 'name',
'root_manifest_id': 'root_manifest_id',
'started_at': 'started_at',
'state': 'state',
'updated_at': 'updated_at',
'when': 'when'
}
def __init__(self, created_at=None, description=None, device_filter=None, etag=None, finished=None, id=None, name=None, root_manifest_id=None, started_at=None, state=None, updated_at=None, when=None):
"""
UpdateCampaignInNinFilter - a model defined in Swagger
"""
self._created_at = created_at
self._description = description
self._device_filter = device_filter
self._etag = etag
self._finished = finished
self._id = id
self._name = name
self._root_manifest_id = root_manifest_id
self._started_at = started_at
self._state = state
self._updated_at = updated_at
self._when = when
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this UpdateCampaignInNinFilter.
:return: The created_at of this UpdateCampaignInNinFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this UpdateCampaignInNinFilter.
:param created_at: The created_at of this UpdateCampaignInNinFilter.
:type: datetime
"""
self._created_at = created_at
@property
def description(self):
"""
Gets the description of this UpdateCampaignInNinFilter.
:return: The description of this UpdateCampaignInNinFilter.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this UpdateCampaignInNinFilter.
:param description: The description of this UpdateCampaignInNinFilter.
:type: str
"""
self._description = description
@property
def device_filter(self):
"""
Gets the device_filter of this UpdateCampaignInNinFilter.
:return: The device_filter of this UpdateCampaignInNinFilter.
:rtype: str
"""
return self._device_filter
@device_filter.setter
def device_filter(self, device_filter):
"""
Sets the device_filter of this UpdateCampaignInNinFilter.
:param device_filter: The device_filter of this UpdateCampaignInNinFilter.
:type: str
"""
self._device_filter = device_filter
@property
def etag(self):
"""
Gets the etag of this UpdateCampaignInNinFilter.
:return: The etag of this UpdateCampaignInNinFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this UpdateCampaignInNinFilter.
:param etag: The etag of this UpdateCampaignInNinFilter.
:type: datetime
"""
self._etag = etag
@property
def finished(self):
"""
Gets the finished of this UpdateCampaignInNinFilter.
:return: The finished of this UpdateCampaignInNinFilter.
:rtype: datetime
"""
return self._finished
@finished.setter
def finished(self, finished):
"""
Sets the finished of this UpdateCampaignInNinFilter.
:param finished: The finished of this UpdateCampaignInNinFilter.
:type: datetime
"""
self._finished = finished
@property
def id(self):
"""
Gets the id of this UpdateCampaignInNinFilter.
:return: The id of this UpdateCampaignInNinFilter.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this UpdateCampaignInNinFilter.
:param id: The id of this UpdateCampaignInNinFilter.
:type: str
"""
self._id = id
@property
def name(self):
"""
Gets the name of this UpdateCampaignInNinFilter.
:return: The name of this UpdateCampaignInNinFilter.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this UpdateCampaignInNinFilter.
:param name: The name of this UpdateCampaignInNinFilter.
:type: str
"""
self._name = name
@property
def root_manifest_id(self):
"""
Gets the root_manifest_id of this UpdateCampaignInNinFilter.
:return: The root_manifest_id of this UpdateCampaignInNinFilter.
:rtype: str
"""
return self._root_manifest_id
@root_manifest_id.setter
def root_manifest_id(self, root_manifest_id):
"""
Sets the root_manifest_id of this UpdateCampaignInNinFilter.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignInNinFilter.
:type: str
"""
self._root_manifest_id = root_manifest_id
@property
def started_at(self):
"""
Gets the started_at of this UpdateCampaignInNinFilter.
:return: The started_at of this UpdateCampaignInNinFilter.
:rtype: datetime
"""
return self._started_at
@started_at.setter
def started_at(self, started_at):
"""
Sets the started_at of this UpdateCampaignInNinFilter.
:param started_at: The started_at of this UpdateCampaignInNinFilter.
:type: datetime
"""
self._started_at = started_at
@property
def state(self):
"""
Gets the state of this UpdateCampaignInNinFilter.
:return: The state of this UpdateCampaignInNinFilter.
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""
Sets the state of this UpdateCampaignInNinFilter.
:param state: The state of this UpdateCampaignInNinFilter.
:type: str
"""
self._state = state
@property
def updated_at(self):
"""
Gets the updated_at of this UpdateCampaignInNinFilter.
:return: The updated_at of this UpdateCampaignInNinFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this UpdateCampaignInNinFilter.
:param updated_at: The updated_at of this UpdateCampaignInNinFilter.
:type: datetime
"""
self._updated_at = updated_at
@property
def when(self):
"""
Gets the when of this UpdateCampaignInNinFilter.
:return: The when of this UpdateCampaignInNinFilter.
:rtype: datetime
"""
return self._when
@when.setter
def when(self, when):
"""
Sets the when of this UpdateCampaignInNinFilter.
:param when: The when of this UpdateCampaignInNinFilter.
:type: datetime
"""
self._when = when
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdateCampaignInNinFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdateCampaignInNinFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, description=None, device_filter=None, etag=None, finished=None, id=None, name=None, root_manifest_id=None, started_at=None, state=None, updated_at=None, when=None):
'''
UpdateCampaignInNinFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this UpdateCampaignInNinFilter.
:return: The created_at of this UpdateCampaignInNinFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this UpdateCampaignInNinFilter.
:param created_at: The created_at of this UpdateCampaignInNinFilter.
:type: datetime
'''
pass
@property
def description(self):
'''
Gets the description of this UpdateCampaignInNinFilter.
:return: The description of this UpdateCampaignInNinFilter.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this UpdateCampaignInNinFilter.
:param description: The description of this UpdateCampaignInNinFilter.
:type: str
'''
pass
@property
def device_filter(self):
'''
Gets the device_filter of this UpdateCampaignInNinFilter.
:return: The device_filter of this UpdateCampaignInNinFilter.
:rtype: str
'''
pass
@device_filter.setter
def device_filter(self):
'''
Sets the device_filter of this UpdateCampaignInNinFilter.
:param device_filter: The device_filter of this UpdateCampaignInNinFilter.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this UpdateCampaignInNinFilter.
:return: The etag of this UpdateCampaignInNinFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this UpdateCampaignInNinFilter.
:param etag: The etag of this UpdateCampaignInNinFilter.
:type: datetime
'''
pass
@property
def finished(self):
'''
Gets the finished of this UpdateCampaignInNinFilter.
:return: The finished of this UpdateCampaignInNinFilter.
:rtype: datetime
'''
pass
@finished.setter
def finished(self):
'''
Sets the finished of this UpdateCampaignInNinFilter.
:param finished: The finished of this UpdateCampaignInNinFilter.
:type: datetime
'''
pass
@property
def id(self):
'''
Gets the id of this UpdateCampaignInNinFilter.
:return: The id of this UpdateCampaignInNinFilter.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this UpdateCampaignInNinFilter.
:param id: The id of this UpdateCampaignInNinFilter.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this UpdateCampaignInNinFilter.
:return: The name of this UpdateCampaignInNinFilter.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this UpdateCampaignInNinFilter.
:param name: The name of this UpdateCampaignInNinFilter.
:type: str
'''
pass
@property
def root_manifest_id(self):
'''
Gets the root_manifest_id of this UpdateCampaignInNinFilter.
:return: The root_manifest_id of this UpdateCampaignInNinFilter.
:rtype: str
'''
pass
@root_manifest_id.setter
def root_manifest_id(self):
'''
Sets the root_manifest_id of this UpdateCampaignInNinFilter.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignInNinFilter.
:type: str
'''
pass
@property
def started_at(self):
'''
Gets the started_at of this UpdateCampaignInNinFilter.
:return: The started_at of this UpdateCampaignInNinFilter.
:rtype: datetime
'''
pass
@started_at.setter
def started_at(self):
'''
Sets the started_at of this UpdateCampaignInNinFilter.
:param started_at: The started_at of this UpdateCampaignInNinFilter.
:type: datetime
'''
pass
@property
def state(self):
'''
Gets the state of this UpdateCampaignInNinFilter.
:return: The state of this UpdateCampaignInNinFilter.
:rtype: str
'''
pass
@state.setter
def state(self):
'''
Sets the state of this UpdateCampaignInNinFilter.
:param state: The state of this UpdateCampaignInNinFilter.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this UpdateCampaignInNinFilter.
:return: The updated_at of this UpdateCampaignInNinFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this UpdateCampaignInNinFilter.
:param updated_at: The updated_at of this UpdateCampaignInNinFilter.
:type: datetime
'''
pass
@property
def when(self):
'''
Gets the when of this UpdateCampaignInNinFilter.
:return: The when of this UpdateCampaignInNinFilter.
:rtype: datetime
'''
pass
@when.setter
def when(self):
'''
Sets the when of this UpdateCampaignInNinFilter.
:param when: The when of this UpdateCampaignInNinFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 55 | 31 | 9 | 1 | 3 | 5 | 1 | 1.03 | 1 | 3 | 0 | 0 | 30 | 13 | 30 | 30 | 367 | 73 | 145 | 73 | 90 | 149 | 85 | 49 | 54 | 5 | 1 | 2 | 35 |
2,526 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/connect/notifications.py
|
mbed_cloud.connect.notifications.AsyncConsumer
|
class AsyncConsumer(object):
"""Consumer object for reading values from a notifications thread.
Example usage:
.. code-block:: python
async_resp = api.get_resource_value(device, resource)
while not async_resp.is_done:
time.sleep(0.1)
if async_resp.error:
raise Exception("Async error: %r" % async_resp.error)
print("Got value: %r" % (async_resp.value,))
"""
def __init__(self, async_id, db):
"""Setup the consumer, listening for a specific async ID to appear in external DB.
The DB is populated from the notifications thread.
"""
self.async_id = async_id
self.db = db
def wait(self, timeout=0):
"""Blocks until timeout (seconds) or forever
:param timeout: time to wait, in seconds
:return:
"""
start_time = time.time()
# We return synchronously, so we block in a busy loop waiting for the
# request to be done.
while not self.is_done:
duration = time.time() - start_time
if timeout and duration > timeout:
raise CloudTimeoutError(
"Timeout getting async value. Timeout: %d seconds" % timeout
)
time.sleep(0.1)
# If we get an any status code other than a 2xx we raise an exception to the user, which can then be handled
# accordingly.
status_code, error_msg, payload = self.check_error()
if not self._status_ok(status_code):
raise CloudAsyncError("Async response for '%s' returned an error." % self.async_id,
reason=error_msg,
status=status_code)
value = self.value
if isinstance(value, six.binary_type):
value = value.decode('utf-8')
return value
@staticmethod
def _status_ok(status_code):
"""Check the status code is in the 2xx range"""
return 200 <= status_code <= 299
@property
def is_done(self):
"""Check if the DB has received an event with the specified async ID.
:return: Whether the async request has finished or not
:rtype: bool
"""
return self.async_id in self.db
def check_error(self):
"""Check if the async response is an error.
Take care to call `is_done` before calling `error`. Note that the error
messages are always encoded as strings.
:raises CloudUnhandledError: When not checking `is_done` first
:return: status_code, error_msg, payload
:rtype: tuple
"""
if not self.is_done:
raise CloudUnhandledError("Need to check if request is done, before checking for error")
response = self.db[self.async_id]
error_msg = response["error"]
status_code = int(response["status_code"])
payload = response["payload"]
return status_code, error_msg, payload
@property
def error(self):
"""Check if the async response is an error.
Take care to call `is_done` before calling `error`. Note that the error
messages are always encoded as strings.
:raises CloudUnhandledError: When not checking `is_done` first
:return: the error value/payload, if found.
:rtype: str
"""
status_code, error_msg, payload = self.check_error()
if status_code != 200 and not error_msg and not payload:
return "Async error (%s). Status code: %r" % (self.async_id, status_code)
return error_msg
@property
def value(self):
"""Get the value of the finished async request, if it is available.
:raises CloudUnhandledError: When not checking value of `error` or `is_done` first
:return: the payload value
:rtype: str
"""
status_code, error_msg, payload = self.check_error()
if not self._status_ok(status_code) and not payload:
raise CloudUnhandledError("Attempted to decode async request which returned an error.",
reason=error_msg,
status=status_code)
return self.db[self.async_id]["payload"]
def to_dict(self):
"""JSON serializable representation of the consumer."""
return str(self)
def __repr__(self):
"""String representation of this AsyncConsumer."""
return self.async_id
|
class AsyncConsumer(object):
'''Consumer object for reading values from a notifications thread.
Example usage:
.. code-block:: python
async_resp = api.get_resource_value(device, resource)
while not async_resp.is_done:
time.sleep(0.1)
if async_resp.error:
raise Exception("Async error: %r" % async_resp.error)
print("Got value: %r" % (async_resp.value,))
'''
def __init__(self, async_id, db):
'''Setup the consumer, listening for a specific async ID to appear in external DB.
The DB is populated from the notifications thread.
'''
pass
def wait(self, timeout=0):
'''Blocks until timeout (seconds) or forever
:param timeout: time to wait, in seconds
:return:
'''
pass
@staticmethod
def _status_ok(status_code):
'''Check the status code is in the 2xx range'''
pass
@property
def is_done(self):
'''Check if the DB has received an event with the specified async ID.
:return: Whether the async request has finished or not
:rtype: bool
'''
pass
def check_error(self):
'''Check if the async response is an error.
Take care to call `is_done` before calling `error`. Note that the error
messages are always encoded as strings.
:raises CloudUnhandledError: When not checking `is_done` first
:return: status_code, error_msg, payload
:rtype: tuple
'''
pass
@property
def error(self):
'''Check if the async response is an error.
Take care to call `is_done` before calling `error`. Note that the error
messages are always encoded as strings.
:raises CloudUnhandledError: When not checking `is_done` first
:return: the error value/payload, if found.
:rtype: str
'''
pass
@property
def value(self):
'''Get the value of the finished async request, if it is available.
:raises CloudUnhandledError: When not checking value of `error` or `is_done` first
:return: the payload value
:rtype: str
'''
pass
def to_dict(self):
'''JSON serializable representation of the consumer.'''
pass
def __repr__(self):
'''String representation of this AsyncConsumer.'''
pass
| 14 | 10 | 11 | 1 | 5 | 4 | 2 | 0.87 | 1 | 5 | 3 | 0 | 8 | 2 | 9 | 9 | 127 | 26 | 54 | 26 | 40 | 47 | 44 | 22 | 34 | 5 | 1 | 2 | 16 |
2,527 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/connect/metric.py
|
mbed_cloud.connect.metric.Metric
|
class Metric(BaseObject):
"""Describes Metric object from statistics."""
@staticmethod
def _get_attributes_map():
return {
"id": "id",
"timestamp": "timestamp",
"handshakes": "handshakes_successful",
"transactions": "transactions",
"observations": "device_observations",
"successful_api_calls": "connect_rest_api_success",
"failed_api_calls": "connect_rest_api_error",
"successful_proxy_requests": "device_proxy_request_success",
"failed_proxy_requests": "device_proxy_request_error",
"successful_subscription_requests": "device_subscription_request_success",
"failed_subscription_requests": "device_subscription_request_error",
"successful_bootstraps": "bootstraps_successful",
"failed_bootstraps": "bootstraps_failed",
"pending_bootstraps": "bootstraps_pending",
"full_registrations": "full_registrations",
"updated_registrations": "registration_updates",
"expired_registrations": "expired_registrations",
"deleted_registrations": "deleted_registrations"
}
@staticmethod
def _map_includes(include):
if include is None:
include = []
includes = []
attributes_map = Metric._get_attributes_map()
for key in include:
val = attributes_map.get(key, None)
if val is not None:
includes.append(val)
if len(includes) == 0:
for key, value in iteritems(attributes_map):
if key != "id" and key != "timestamp":
includes.append(value)
s = ','
return s.join(includes)
@property
def id(self):
"""The ID of the metric.
:rtype: string
"""
return self._id
@property
def timestamp(self):
"""UTC time in RFC3339 format.
The timestamp is the starting point of the interval for which the data is aggregated.
Each interval includes data for the time greater than or equal to the timestamp
and less than the next interval's starting point.
:return: The timestamp of this Metric.
:rtype: datetime
"""
return self._timestamp
@property
def handshakes(self):
"""The number of successful TLS handshakes the account has performed.
The SSL or TLS handshake enables the SSL or TLS client and server to establish the
secret keys with which they communicate. A successful TLS handshake is required
for establishing a connection with Pelion Device Management for any operaton such as registration,
registration update and deregistration.
:rtype: int
"""
return self._handshakes
@property
def transactions(self):
"""The number of transaction events from or to devices linked to the account.
A transaction is a 512-byte block of data processed by Pelion Device Management.
It can be either sent by the device (device --> Pelion Device Management) or received by the device
(Pelion Device Management --> device). A transaction does not include
IP, TCP or UDP, TLS or DTLS packet overhead.
It only contains the packet payload (full CoAP packet including CoAP headers).
:rtype: int
"""
return self._transactions
@property
def observations(self):
"""The number of observations received by Pelion Device Management from the devices.
The observations are pushed from the devices linked to the account to Pelion Device Management
when you have successfully subscribed to the device resources using Connect API endpoints.
:rtype: int
"""
return self._observations
@property
def successful_api_calls(self):
"""The number of successful requests the account has performed.
:rtype: int
"""
return self._successful_api_calls
@property
def failed_api_calls(self):
"""The number of failed requests the account has performed.
:rtype: int
"""
return self._failed_api_calls
@property
def successful_proxy_requests(self):
"""The number of successful proxy requests from Pelion Device Management to devices.
The proxy requests are made from Pelion Device Management to devices linked to
the account when you try to read or write values to device resources
using Connect API endpoints.
:rtype: int
"""
return self._successful_proxy_requests
@property
def failed_proxy_requests(self):
"""The number of failed proxy requests from Pelion Device Management to devices.
The proxy requests are made from Pelion Device Management to devices linked to
the account when you try to read or write values to device resources
using Connect API endpoints.
:rtype: int
"""
return self._failed_proxy_requests
@property
def successful_subscription_requests(self):
"""The number of successful subscription requests from Pelion Device Management to devices.
The subscription requests are made from Pelion Device Management to devices linked to
the account when you try to subscribe to a resource path using Connect API endpoints.
:rtype: int
"""
return self._successful_subscription_requests
@property
def failed_subscription_requests(self):
"""The number of failed subscription requests from Pelion Device Management to devices.
The subscription requests are made from Pelion Device Management to devices linked to
the account when you try to subscribe to a resource path using Connect API endpoints.
:rtype: int
"""
return self._failed_subscription_requests
@property
def pending_bootstraps(self):
"""The number of pending bootstraps the account has performed.
Bootstrap is the process of provisioning a Lightweight Machine to Machine Client
to a state where it can initiate a management session to a new Lightweight Machine
to Machine Server.
:rtype: int
"""
return self._pending_bootstraps
@property
def successful_bootstraps(self):
"""The number of successful bootstraps the account has performed.
Bootstrap is the process of provisioning a Lightweight Machine to Machine Client
to a state where it can initiate a management session to a new Lightweight Machine
to Machine Server.
:rtype: int
"""
return self._successful_bootstraps
@property
def failed_bootstraps(self):
"""The number of failed bootstraps the account has performed.
Bootstrap is the process of provisioning a Lightweight Machine to Machine Client
to a state where it can initiate a management session to
a new Lightweight Machine to Machine Server.
:rtype: int
"""
return self._failed_bootstraps
@property
def full_registrations(self):
"""The number of full registrations linked to the account.
Full registration is the process of registering a device with the Pelion Device Management
by providing its lifetime and capabilities such as the resource structure.
The registered status of the device does not guarantee that the device is active
and accessible from Mebd Cloud Connect at any point of time.
:rtype: int
"""
return self._full_registrations
@property
def updated_registrations(self):
"""The number of registration updates linked to the account.
Registration update is the process of updating the registration status with
the Pelion Device Management to update or extend the lifetime of the device.
:rtype: int
"""
return self._updated_registrations
@property
def expired_registrations(self):
"""The number of expired registrations linked to the account.
Pelion Device Management removes the device registrations when the devices cannot update
their registration before the expiry of the lifetime. Pelion Device Management
no longer handles requests for a device whose registration has expired already.
:rtype: int
"""
return self._expired_registrations
@property
def deleted_registrations(self):
"""The number of deleted registrations (deregistrations) linked to the account.
Deregistration is the process of removing the device registration from the
Pelion Device Management registry. The deregistration is usually initiated by the device.
Pelion Device Management no longer handles requests for a deregistered device.
:rtype: int
"""
return self._deleted_registrations
|
class Metric(BaseObject):
'''Describes Metric object from statistics.'''
@staticmethod
def _get_attributes_map():
pass
@staticmethod
def _map_includes(include):
pass
@property
def id(self):
'''The ID of the metric.
:rtype: string
'''
pass
@property
def timestamp(self):
'''UTC time in RFC3339 format.
The timestamp is the starting point of the interval for which the data is aggregated.
Each interval includes data for the time greater than or equal to the timestamp
and less than the next interval's starting point.
:return: The timestamp of this Metric.
:rtype: datetime
'''
pass
@property
def handshakes(self):
'''The number of successful TLS handshakes the account has performed.
The SSL or TLS handshake enables the SSL or TLS client and server to establish the
secret keys with which they communicate. A successful TLS handshake is required
for establishing a connection with Pelion Device Management for any operaton such as registration,
registration update and deregistration.
:rtype: int
'''
pass
@property
def transactions(self):
'''The number of transaction events from or to devices linked to the account.
A transaction is a 512-byte block of data processed by Pelion Device Management.
It can be either sent by the device (device --> Pelion Device Management) or received by the device
(Pelion Device Management --> device). A transaction does not include
IP, TCP or UDP, TLS or DTLS packet overhead.
It only contains the packet payload (full CoAP packet including CoAP headers).
:rtype: int
'''
pass
@property
def observations(self):
'''The number of observations received by Pelion Device Management from the devices.
The observations are pushed from the devices linked to the account to Pelion Device Management
when you have successfully subscribed to the device resources using Connect API endpoints.
:rtype: int
'''
pass
@property
def successful_api_calls(self):
'''The number of successful requests the account has performed.
:rtype: int
'''
pass
@property
def failed_api_calls(self):
'''The number of failed requests the account has performed.
:rtype: int
'''
pass
@property
def successful_proxy_requests(self):
'''The number of successful proxy requests from Pelion Device Management to devices.
The proxy requests are made from Pelion Device Management to devices linked to
the account when you try to read or write values to device resources
using Connect API endpoints.
:rtype: int
'''
pass
@property
def failed_proxy_requests(self):
'''The number of failed proxy requests from Pelion Device Management to devices.
The proxy requests are made from Pelion Device Management to devices linked to
the account when you try to read or write values to device resources
using Connect API endpoints.
:rtype: int
'''
pass
@property
def successful_subscription_requests(self):
'''The number of successful subscription requests from Pelion Device Management to devices.
The subscription requests are made from Pelion Device Management to devices linked to
the account when you try to subscribe to a resource path using Connect API endpoints.
:rtype: int
'''
pass
@property
def failed_subscription_requests(self):
'''The number of failed subscription requests from Pelion Device Management to devices.
The subscription requests are made from Pelion Device Management to devices linked to
the account when you try to subscribe to a resource path using Connect API endpoints.
:rtype: int
'''
pass
@property
def pending_bootstraps(self):
'''The number of pending bootstraps the account has performed.
Bootstrap is the process of provisioning a Lightweight Machine to Machine Client
to a state where it can initiate a management session to a new Lightweight Machine
to Machine Server.
:rtype: int
'''
pass
@property
def successful_bootstraps(self):
'''The number of successful bootstraps the account has performed.
Bootstrap is the process of provisioning a Lightweight Machine to Machine Client
to a state where it can initiate a management session to a new Lightweight Machine
to Machine Server.
:rtype: int
'''
pass
@property
def failed_bootstraps(self):
'''The number of failed bootstraps the account has performed.
Bootstrap is the process of provisioning a Lightweight Machine to Machine Client
to a state where it can initiate a management session to
a new Lightweight Machine to Machine Server.
:rtype: int
'''
pass
@property
def full_registrations(self):
'''The number of full registrations linked to the account.
Full registration is the process of registering a device with the Pelion Device Management
by providing its lifetime and capabilities such as the resource structure.
The registered status of the device does not guarantee that the device is active
and accessible from Mebd Cloud Connect at any point of time.
:rtype: int
'''
pass
@property
def updated_registrations(self):
'''The number of registration updates linked to the account.
Registration update is the process of updating the registration status with
the Pelion Device Management to update or extend the lifetime of the device.
:rtype: int
'''
pass
@property
def expired_registrations(self):
'''The number of expired registrations linked to the account.
Pelion Device Management removes the device registrations when the devices cannot update
their registration before the expiry of the lifetime. Pelion Device Management
no longer handles requests for a device whose registration has expired already.
:rtype: int
'''
pass
@property
def deleted_registrations(self):
'''The number of deleted registrations (deregistrations) linked to the account.
Deregistration is the process of removing the device registration from the
Pelion Device Management registry. The deregistration is usually initiated by the device.
Pelion Device Management no longer handles requests for a deregistered device.
:rtype: int
'''
pass
| 41 | 19 | 10 | 2 | 4 | 5 | 1 | 1.09 | 1 | 0 | 0 | 0 | 18 | 0 | 20 | 28 | 247 | 53 | 93 | 47 | 52 | 101 | 54 | 27 | 33 | 7 | 2 | 3 | 26 |
2,528 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/configuration.py
|
mbed_cloud.configuration.Config
|
class Config(dict):
"""Create configuration dict, reading config file(s) on initialisation."""
path_from_env_key = 'MBED_CLOUD_SDK_CONFIG'
def __init__(self, updates=None):
"""Go through list of directories in priority order and add to config.
For each file which is found and valid, we extend/overwrite the existing
config dictionary.
Of highest priority is using the `MBED_CLOUD_SDK_CONFIG` environment
variable, to specify a config JSON file.
"""
# if no root logger is defined yet, configure a default stream handler
logging.basicConfig(level=logging.INFO)
self._using_paths = []
try:
self.load(updates=updates)
except Exception:
raise Exception(
"There was a problem loading the SDK configuration file.\n"
"Paths attempted, in priority order: \n\t%s\n"
"Config file can be set using env key: `%s`\n"
"The original traceback is recorded below:\n"
"\n%s"
% (',\n\t'.join(self._using_paths), self.path_from_env_key, traceback.format_exc())
)
def paths(self):
"""Get list of paths to look in for configuration data"""
filename = '.mbed_cloud_config.json'
return [
# Global config in /etc for *nix users
"/etc/%s" % filename,
# Config file in home directory
os.path.join(os.path.expanduser("~"), filename),
# Config file in current directory
os.path.join(os.getcwd(), filename),
# Config file specified using environment variable
os.environ.get(self.path_from_env_key)
]
def load(self, updates):
"""Load configuration data"""
# Go through in order and override the config (`.mbed_cloud_config.json` loader)
for path in self.paths():
if not path:
continue
abs_path = os.path.abspath(os.path.expanduser(path))
if not os.path.isfile(abs_path):
self._using_paths.append('missing: %s' % abs_path)
continue
self._using_paths.append(' exists: %s' % abs_path)
with open(abs_path) as fh:
self.update(json.load(fh))
# New dotenv loader - requires explicit instructions to use current working directory
load_dotenv(find_dotenv(usecwd=True))
# Pluck config values out of the environment
for env_var, key in {ENVVAR_API_HOST: 'host', ENVVAR_API_KEY: 'api_key'}.items():
env_value = os.getenv(env_var)
if env_value is not None:
self[key] = env_value
if updates:
self.update(updates)
self.validate()
def validate(self):
"""Validate / fix up the current config"""
if not self.get('api_key'):
raise ValueError("api_key not found in config. Please see documentation.")
host = self.get('host') or DEFAULT_CLOUD_HOST
if host:
# remove extraneous slashes and force to byte string
# otherwise msg += message_body in httplib will fail in python2
# when message_body contains binary data, and url is unicode
# remaining failure modes include at least:
# passing bytes in python3 will fail as we try to strip unicode '/' characters
# passing unicode code points in python2 will fail due to httplib host.encode('ascii')
host = host.strip('/')
if not isinstance(host, str):
host = host.encode('utf-8')
self['host'] = host
self.setdefault('autostart_notification_thread', True)
|
class Config(dict):
'''Create configuration dict, reading config file(s) on initialisation.'''
def __init__(self, updates=None):
'''Go through list of directories in priority order and add to config.
For each file which is found and valid, we extend/overwrite the existing
config dictionary.
Of highest priority is using the `MBED_CLOUD_SDK_CONFIG` environment
variable, to specify a config JSON file.
'''
pass
def paths(self):
'''Get list of paths to look in for configuration data'''
pass
def load(self, updates):
'''Load configuration data'''
pass
def validate(self):
'''Validate / fix up the current config'''
pass
| 5 | 5 | 21 | 3 | 13 | 6 | 4 | 0.45 | 1 | 3 | 0 | 0 | 4 | 1 | 4 | 31 | 93 | 16 | 53 | 14 | 48 | 24 | 41 | 13 | 36 | 7 | 2 | 2 | 14 |
2,529 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/client/client.py
|
mbed_cloud.client.client.Client
|
class Client(object):
"""Client Interface to give direct access to the Pelion Device Management API."""
def __init__(self, config):
"""An http client container
:param config: An SDK configuration object.
:type config: mbed_cloud.sdk.config.Config
"""
self.config = config
self.session = requests.Session()
self.session.headers.update(
{
"Authorization": "Bearer %s" % self.config.api_key,
"User-Agent": utils.get_user_agent(),
}
)
def call_api(
self,
method,
path,
headers=None,
path_params=None,
query_params=None,
body_params=None,
stream_params=None,
binary_data=None,
content_type=None,
unpack=None,
**kwargs
):
"""Make an HTTP request handling to the Pelion Device Management REST API.
This method uses the `Requests HTTP Library <http://docs.python-requests.org/en/master/>`_. to interact with the
Pelion Device Management REST API. For more information on request and response objects please the third party
documentation.
.. code-block:: python
from mbed_cloud import SDK
pelion_dm_sdk = SDK()
api_client = pelion_dm_sdk.client()
response = api_client.call_api(
method="put",
path="/v3/path-to-resource/{an_id}",
path_params={
"an_id": "0123456789"
},
body_params={
"a_field": "field value",
},
query_params={
"a_query_param": "query_param_value",
}
)
:param method: HTTP Method
:type method: str
:param path: Path relative to the configured host (with variable substitution using `{format}` syntax)
:type path: str
:param headers: (optional) HTTP Headers (Auth is not required, Content-Type can be provided via content_type)
:type headers: dict
:param path_params: (optional) Path parameters (substituted into the `path` parameter)
:type path_params: dict
:param query_params: (optional) Query Parameters
:type query_params: dict
:param body_params: (optional) JSON-compatible Message Body
:type body_params: dict
:param stream_params: (optional) Files for multipart encoding uploading, see 'requests.request.files` for more
information.
:type stream_params: dict
:param binary_data: (optional) Binary data suitable for binary/octet-stream content type.
:type binary_data: str/byte
:param content_type: (optional) Content-Type of the request, if defined this will be added to the HTTP Headers.
:type content_type: str
:param unpack: (optional) Unpack the response into this Entity
:type unpack: mbed_cloud.foundation.common.entity_base.Entity
:param kwargs: (optional) Addition parameters to be passed to `requests.Session().request`
:return: Either a response object or an Entity instance
:rtype: mbed_cloud.foundation.common.entity_base.Entity requests.Response
"""
url = self.config.host + path
if path_params:
url = url.format(**path_params)
if binary_data and not content_type:
content_type = "application/octet-stream"
if content_type:
if headers is None:
headers = {}
headers.update({"Content-Type": content_type})
response = self.session.request(
method=method,
url=url,
headers=headers,
params=query_params,
json=body_params,
data=binary_data,
files=stream_params,
**kwargs
)
# happy path - we successfully connect and receive a 2XX response:
if response.status_code // 100 == 2:
if not unpack:
return response
if inspect.isclass(unpack):
unpack = unpack() # noqa - we're going to instantiate it
try:
decoded = (response.content or {}) and response.json()
except Exception as e:
# TODO: support other content types here
self.config.logger.error(
"Failed to unpack response body:\n%r", response.content
)
if isinstance(unpack, Entity):
# If nothing is returned from the API but the response should be unpacked into an Entity, then
# return the original entity instance. Some endpoints do not return a created or modified instance
# on POST or PUT, which is out of spec but handle it.
return unpack
else:
e.response = response
raise e
else:
return unpack.from_api(**decoded)
# else the response indicates an error, so the rest of this is error handling:
# check for common failure causes
all_params = locals()
api_key = self.config.api_key or ""
host = self.config.host
hints = [
"Request parameters:",
"URL: %s" % url,
"HTTP method: %s, api_key: '%s%s%s'"
% (method.upper(), api_key[:6], "***" if api_key else "", api_key[-3:]),
"Any additional parameters are attached to this %s instance."
% ApiErrorResponse.__name__,
]
if not api_key:
hints.append(
"There was no API key detected. You need to set one to interact with the cloud "
"(See: https://cloud.mbed.com/docs/current/integrate-web-app/api-keys.html)."
)
if not host.startswith("https"):
hints.append(
"The host scheme should start with 'https' for a secure connection to the cloud."
)
if path_params and not all(path_params.values()):
hints.append(
"Some parameters required in the URL appear to be missing:\n%s"
% util.pretty_literal(path_params)
)
try:
content = json.loads(response.content)
except Exception: # noqa
# we don't care why loading the error content fails. maybe the API changed? log it.
self.config.logger.warning("Failed to unpack error body as json")
content = {"response": response.content}
else:
# remap error response fields too!
try:
if unpack:
fields = content.get("fields", [])
util.remap_error_fields(unpack._renames, fields)
for field in fields:
fieldname = (
field.get("name", "") if isinstance(field, dict) else field
)
hints.append(
"Docs for %r field:\n\t%s"
% (
fieldname,
getattr(unpack.__class__, fieldname, None).__doc__,
)
)
except Exception: # noqa
# we don't care why remapping the field fails. we gave it a go! log it.
self.config.logger.exception("Failed to remap fields")
api_feedback = util.pretty_literal(content)
hints = "\n".join(hints)
# build and raise an Exception
error = ApiErrorResponse(
"Error response from API (HTTP %s):\n%s\n%s"
% (response.status_code, api_feedback, hints)
)
error.content = content
error.status_code = response.status_code
error.raw = all_params.pop("response")
error.all_parameters = all_params
raise error
|
class Client(object):
'''Client Interface to give direct access to the Pelion Device Management API.'''
def __init__(self, config):
'''An http client container
:param config: An SDK configuration object.
:type config: mbed_cloud.sdk.config.Config
'''
pass
def call_api(
self,
method,
path,
headers=None,
path_params=None,
query_params=None,
body_params=None,
stream_params=None,
binary_data=None,
content_type=None,
unpack=None,
**kwargs
):
'''Make an HTTP request handling to the Pelion Device Management REST API.
This method uses the `Requests HTTP Library <http://docs.python-requests.org/en/master/>`_. to interact with the
Pelion Device Management REST API. For more information on request and response objects please the third party
documentation.
.. code-block:: python
from mbed_cloud import SDK
pelion_dm_sdk = SDK()
api_client = pelion_dm_sdk.client()
response = api_client.call_api(
method="put",
path="/v3/path-to-resource/{an_id}",
path_params={
"an_id": "0123456789"
},
body_params={
"a_field": "field value",
},
query_params={
"a_query_param": "query_param_value",
}
)
:param method: HTTP Method
:type method: str
:param path: Path relative to the configured host (with variable substitution using `{format}` syntax)
:type path: str
:param headers: (optional) HTTP Headers (Auth is not required, Content-Type can be provided via content_type)
:type headers: dict
:param path_params: (optional) Path parameters (substituted into the `path` parameter)
:type path_params: dict
:param query_params: (optional) Query Parameters
:type query_params: dict
:param body_params: (optional) JSON-compatible Message Body
:type body_params: dict
:param stream_params: (optional) Files for multipart encoding uploading, see 'requests.request.files` for more
information.
:type stream_params: dict
:param binary_data: (optional) Binary data suitable for binary/octet-stream content type.
:type binary_data: str/byte
:param content_type: (optional) Content-Type of the request, if defined this will be added to the HTTP Headers.
:type content_type: str
:param unpack: (optional) Unpack the response into this Entity
:type unpack: mbed_cloud.foundation.common.entity_base.Entity
:param kwargs: (optional) Addition parameters to be passed to `requests.Session().request`
:return: Either a response object or an Entity instance
:rtype: mbed_cloud.foundation.common.entity_base.Entity requests.Response
'''
pass
| 3 | 3 | 99 | 9 | 60 | 32 | 10 | 0.54 | 1 | 5 | 2 | 0 | 2 | 2 | 2 | 2 | 201 | 19 | 120 | 32 | 104 | 65 | 64 | 18 | 61 | 19 | 1 | 4 | 20 |
2,530 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/client/api_filter.py
|
mbed_cloud.client.api_filter.ApiFilter
|
class ApiFilter(object):
"""Filter Builder for listing resource from the API."""
def __init__(self, filter_definition=None, field_renames=None):
"""Create an instance of an API filter.
The recommended usage is to use the `add_filter` method to create API filters:
.. code-block:: python
from mbed_cloud import ApiFilter
api_filter = ApiFilter()
api_filter.add_filter("email", "eq", "a.n.other@example.com")
.. code-block:: python
from mbed_cloud import ApiFilter
api_filter = ApiFilter()
api_filter.add_filter("status", "in", ["ACTIVE", "ENROLLING"])
.. code-block:: python
from mbed_cloud import ApiFilter
api_filter = ApiFilter()
api_filter.add_filter("created_at", "gte", datetime(2019, 1, 1))
api_filter.add_filter("created_at", "lte", datetime(2019, 12, 31))
Alternatively a filter can be defined by providing a filter definition as a dict when the class is instantiated:
.. code-block:: python
from mbed_cloud import ApiFilter
my_filter = {
"created_at": {
"gte": datetime(2019, 1, 1),
"lte": datetime(2019, 12, 31)
}
}
api_filter = ApiFilter(filter_definition=my_filter)
*Note: Filters are not supported by the API for all entities and fields, please see the entity for details.*
:param filter_definition: A optional definition of the fields on which to filter along with the operators and
values. `{<Field Name>: {"<Filter Operator>": "<Compassion Value>"}`
:type filter_definition: dict
:param field_renames: An optional definition of renames performed in the Foundation Interface (not required if
using with the Client interface. `{<SDK Name>: <API Name>}`
:type field_renames: dict
"""
self.filter_definition = filter_definition if filter_definition else {}
self.field_renames = field_renames if field_renames else {}
def add_filter(self, field, operator, value):
"""Add a new API filter.
*Note: Filters are not supported by the API for all entities and fields, please see the entity for details.*
:param field: Name of the field on which to filter
:type field: str
:param operator: The filter operator, one of `eq`, `neq`, `lte`, `gte`, `in`, `nin` and `like`.
:type operator: str
:param value: The comparison value, one of the basic Python types or a Foundation Entity
e.g. `True`, `7`, `"hello world"`, `["open", "closed"]`, `LoginProfile()`
:type value: str, int, float, list, bool, date, datetime, Entity
"""
self.filter_definition.setdefault(field, {}).update({operator: value})
def to_api(self):
"""Generate filters suitable to being sent to the API as a filter.
This method will only need to be called explicitly when the Client Interface is being used.
"""
api_filter = {}
for sdk_field, sdk_operator_value in self.filter_definition.items():
# If a rename dictionary has been provided then rename the field, otherwise leave as it is
api_field = self.field_renames.get(sdk_field, sdk_field)
try:
# The filter definition should contain a dictionary if filter operators and values
for sdk_operator, sdk_value in sdk_operator_value.items():
# The dictionary may contain multiple filters, process each one
api_value = _to_query_param(sdk_value)
api_filter[api_field + "__" + sdk_operator.lstrip("$")] = api_value
except AttributeError:
# Default to equality if a filter operator was not provided
api_value = _to_query_param(sdk_operator_value)
api_filter[api_field + "__eq"] = api_value
return api_filter
def to_dict(self):
"""Support standard field interface, equivalent to `to_api`."""
return self.to_api()
def to_query_string(self):
"""Generate a query string (not percent encoded."""
key_value_strings = ["%s=%s" % (key, value) for key, value in self.to_api().items()]
key_value_strings.sort()
return "&".join(key_value_strings)
|
class ApiFilter(object):
'''Filter Builder for listing resource from the API.'''
def __init__(self, filter_definition=None, field_renames=None):
'''Create an instance of an API filter.
The recommended usage is to use the `add_filter` method to create API filters:
.. code-block:: python
from mbed_cloud import ApiFilter
api_filter = ApiFilter()
api_filter.add_filter("email", "eq", "a.n.other@example.com")
.. code-block:: python
from mbed_cloud import ApiFilter
api_filter = ApiFilter()
api_filter.add_filter("status", "in", ["ACTIVE", "ENROLLING"])
.. code-block:: python
from mbed_cloud import ApiFilter
api_filter = ApiFilter()
api_filter.add_filter("created_at", "gte", datetime(2019, 1, 1))
api_filter.add_filter("created_at", "lte", datetime(2019, 12, 31))
Alternatively a filter can be defined by providing a filter definition as a dict when the class is instantiated:
.. code-block:: python
from mbed_cloud import ApiFilter
my_filter = {
"created_at": {
"gte": datetime(2019, 1, 1),
"lte": datetime(2019, 12, 31)
}
}
api_filter = ApiFilter(filter_definition=my_filter)
*Note: Filters are not supported by the API for all entities and fields, please see the entity for details.*
:param filter_definition: A optional definition of the fields on which to filter along with the operators and
values. `{<Field Name>: {"<Filter Operator>": "<Compassion Value>"}`
:type filter_definition: dict
:param field_renames: An optional definition of renames performed in the Foundation Interface (not required if
using with the Client interface. `{<SDK Name>: <API Name>}`
:type field_renames: dict
'''
pass
def add_filter(self, field, operator, value):
'''Add a new API filter.
*Note: Filters are not supported by the API for all entities and fields, please see the entity for details.*
:param field: Name of the field on which to filter
:type field: str
:param operator: The filter operator, one of `eq`, `neq`, `lte`, `gte`, `in`, `nin` and `like`.
:type operator: str
:param value: The comparison value, one of the basic Python types or a Foundation Entity
e.g. `True`, `7`, `"hello world"`, `["open", "closed"]`, `LoginProfile()`
:type value: str, int, float, list, bool, date, datetime, Entity
'''
pass
def to_api(self):
'''Generate filters suitable to being sent to the API as a filter.
This method will only need to be called explicitly when the Client Interface is being used.
'''
pass
def to_dict(self):
'''Support standard field interface, equivalent to `to_api`.'''
pass
def to_query_string(self):
'''Generate a query string (not percent encoded.'''
pass
| 6 | 6 | 19 | 4 | 5 | 10 | 2 | 2.21 | 1 | 1 | 0 | 0 | 5 | 2 | 5 | 5 | 103 | 26 | 24 | 14 | 18 | 53 | 24 | 14 | 18 | 4 | 1 | 3 | 10 |
2,531 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/certificates/certificates.py
|
mbed_cloud.certificates.certificates.Enumeration
|
class Enumeration(set):
"""Enumeration class."""
def __getattr__(self, name):
"""Get attribute. Return name of the attribute."""
if name in self:
return name
raise AttributeError
def __setattr__(self, name, value):
"""Set attribute. Method not allowed. Raises RuntimeError."""
raise RuntimeError("Cannot override values in Enum")
def __delattr__(self, name):
"""Delete attribute. Method not allowed. Raises RuntimeError."""
raise RuntimeError("Cannot delete values from Enum")
|
class Enumeration(set):
'''Enumeration class.'''
def __getattr__(self, name):
'''Get attribute. Return name of the attribute.'''
pass
def __setattr__(self, name, value):
'''Set attribute. Method not allowed. Raises RuntimeError.'''
pass
def __delattr__(self, name):
'''Delete attribute. Method not allowed. Raises RuntimeError.'''
pass
| 4 | 4 | 4 | 0 | 3 | 1 | 1 | 0.44 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 46 | 16 | 3 | 9 | 4 | 5 | 4 | 9 | 4 | 5 | 2 | 2 | 1 | 4 |
2,532 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/certificates/certificates.py
|
mbed_cloud.certificates.certificates.Certificate
|
class Certificate(BaseObject):
"""Describes device certificate object."""
@staticmethod
def _get_attributes_map():
return {
"id": "id",
"name": "name",
"description": "description",
"type": "service",
"device_mode": "device_execution_mode",
"status": "status",
"account_id": "account_id",
"certificate_data": "certificate",
"created_at": "created_at",
"updated_at": "updated_at",
"issuer": "issuer",
"subject": "subject",
"validity": "validity",
"owner_id": "owner_id",
"server_uri": "server_uri",
"server_certificate": "server_certificate",
"header_file": "security_file_content",
"developer_certificate": "developer_certificate",
"developer_private_key": "developer_private_key",
"enrollment_mode": "enrollment_mode",
"signature": "signature",
}
@classmethod
def _create_request_map(cls, input_map):
"""Create request map."""
mapped = super(Certificate, cls)._create_request_map(input_map)
if mapped.get('service') == CertificateType.developer:
mapped['service'] = CertificateType.bootstrap
return mapped
@property
def status(self):
"""The status of the certificate.
:return: The status of this certificate.
:rtype: str
"""
return self._status
@property
def signature(self):
"""The signature of the certificate.
This parameter has been DEPRECATED in the API and is no longer used.
:return: The signature of this certificate.
:rtype: str
"""
return self._signature
@property
def enrollment_mode(self):
"""The enrollment_mode of the certificate.
:return: The enrollment_mode of this certificate.
:rtype: str
"""
return self._enrollment_mode
@property
def description(self):
"""Human readable description of this certificate.
:return: The description of this certificate.
:rtype: str
"""
return self._description
@property
def device_mode(self):
"""The device mode
:rtype: str
"""
return self._device_mode
@property
def certificate_data(self):
"""X509.v3 trusted certificate data in PEM format.
:return: The certificate data.
:rtype: str
"""
return self._certificate_data
@property
def issuer(self):
"""Issuer of the certificate.
:return: The issuer of this certificate.
:rtype: str
"""
return self._issuer
@property
def type(self):
"""Certificate type.
:return: The type of the certificate.
:rtype: CertificateType
"""
if self._device_mode == 1 or self._type == CertificateType.developer:
return CertificateType.developer
elif self._type == CertificateType.bootstrap:
return CertificateType.bootstrap
else:
return CertificateType.lwm2m
@property
def created_at(self):
"""Creation UTC time RFC3339.
:rtype: datetime
"""
return self._created_at
@property
def updated_at(self):
"""Update UTC time RFC3339.
:rtype: datetime
"""
return self._updated_at
@property
def subject(self):
"""Subject of the certificate.
:return: The subject of this certificate.
:rtype: str
"""
return self._subject
@property
def account_id(self):
"""The UUID of the account.
:rtype: str
"""
return self._account_id
@property
def validity(self):
"""Expiration time in UTC formatted as RFC3339.
:return: The validity of this certificate.
:rtype: datetime
"""
return self._validity
@property
def owner_id(self):
"""The UUID of the owner.
:rtype: str
"""
return self._owner_id
@property
def id(self):
"""ID of this certificate.
:return: The id of this certificate.
:rtype: str
"""
return self._id
@property
def name(self):
"""Certificate name.
:return: The name of this certificate.
:rtype: str
"""
return self._name
@property
def header_file(self):
"""The content of the `security.c` file that is flashed into the device
to provide the security credentials. Set only for developer certificate.
:rtype: str
"""
return getattr(self, '_header_file', None)
@property
def developer_certificate(self):
"""The PEM format X.509 developer certificate.
Set only for developer certificate.
:rtype: str
"""
return getattr(self, '_developer_certificate', None)
@property
def server_uri(self):
"""The URI to which the client needs to connect to.
:rtype: str
"""
return getattr(self, '_server_uri', None)
@property
def developer_private_key(self):
"""The PEM format developer private key associated with the certificate.
Set only for developer certificate.
:rtype: str
"""
return getattr(self, '_developer_private_key', None)
@property
def server_certificate(self):
"""The PEM format X.509 server certificate that is used to validate
the server certificate that is received during the TLS/DTLS handshake.
:rtype: str
"""
return getattr(self, '_server_certificate', None)
|
class Certificate(BaseObject):
'''Describes device certificate object.'''
@staticmethod
def _get_attributes_map():
pass
@classmethod
def _create_request_map(cls, input_map):
'''Create request map.'''
pass
@property
def status(self):
'''The status of the certificate.
:return: The status of this certificate.
:rtype: str
'''
pass
@property
def signature(self):
'''The signature of the certificate.
This parameter has been DEPRECATED in the API and is no longer used.
:return: The signature of this certificate.
:rtype: str
'''
pass
@property
def enrollment_mode(self):
'''The enrollment_mode of the certificate.
:return: The enrollment_mode of this certificate.
:rtype: str
'''
pass
@property
def description(self):
'''Human readable description of this certificate.
:return: The description of this certificate.
:rtype: str
'''
pass
@property
def device_mode(self):
'''The device mode
:rtype: str
'''
pass
@property
def certificate_data(self):
'''X509.v3 trusted certificate data in PEM format.
:return: The certificate data.
:rtype: str
'''
pass
@property
def issuer(self):
'''Issuer of the certificate.
:return: The issuer of this certificate.
:rtype: str
'''
pass
@property
def type(self):
'''Certificate type.
:return: The type of the certificate.
:rtype: CertificateType
'''
pass
@property
def created_at(self):
'''Creation UTC time RFC3339.
:rtype: datetime
'''
pass
@property
def updated_at(self):
'''Update UTC time RFC3339.
:rtype: datetime
'''
pass
@property
def subject(self):
'''Subject of the certificate.
:return: The subject of this certificate.
:rtype: str
'''
pass
@property
def account_id(self):
'''The UUID of the account.
:rtype: str
'''
pass
@property
def validity(self):
'''Expiration time in UTC formatted as RFC3339.
:return: The validity of this certificate.
:rtype: datetime
'''
pass
@property
def owner_id(self):
'''The UUID of the owner.
:rtype: str
'''
pass
@property
def id(self):
'''ID of this certificate.
:return: The id of this certificate.
:rtype: str
'''
pass
@property
def name(self):
'''Certificate name.
:return: The name of this certificate.
:rtype: str
'''
pass
@property
def header_file(self):
'''The content of the `security.c` file that is flashed into the device
to provide the security credentials. Set only for developer certificate.
:rtype: str
'''
pass
@property
def developer_certificate(self):
'''The PEM format X.509 developer certificate.
Set only for developer certificate.
:rtype: str
'''
pass
@property
def server_uri(self):
'''The URI to which the client needs to connect to.
:rtype: str
'''
pass
@property
def developer_private_key(self):
'''The PEM format developer private key associated with the certificate.
Set only for developer certificate.
:rtype: str
'''
pass
@property
def server_certificate(self):
'''The PEM format X.509 server certificate that is used to validate
the server certificate that is received during the TLS/DTLS handshake.
:rtype: str
'''
pass
| 47 | 23 | 8 | 1 | 3 | 3 | 1 | 0.81 | 1 | 1 | 0 | 0 | 21 | 0 | 23 | 31 | 227 | 46 | 100 | 48 | 53 | 81 | 53 | 25 | 29 | 3 | 2 | 1 | 26 |
2,533 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/bootstrap/bootstrap.py
|
mbed_cloud.bootstrap.bootstrap.PreSharedKey
|
class PreSharedKey(BaseObject):
"""Describes device object from the catalog.
For more information about such keys,
have a look at
https://cloud.mbed.com/docs/latest/connecting/mbed-client-lite-security-considerations.html"
"""
@staticmethod
def _get_attributes_map():
return {
'endpoint_name': 'endpoint_name',
'secret_hex': 'secret_hex',
'created_at': 'created_at',
}
@property
def endpoint_name(self):
"""The endpoint_name of this PreSharedKey.
Endpoint name is the unique ID of the pre-shared key.
16-64 printable (non-control) ASCII characters.
It also must be globally unique.
Consider using vendor-MAC-ID-device-model.
For example "myEndpoint.host.com"
:param endpoint_name: The endpoint_name of this PreSharedKey.
:type: str
"""
return self._endpoint_name
@property
def secret_hex(self):
"""The secret_hex of this PreSharedKey.
The secret of the pre-shared key in HEX format.
- It is not case sensitive; 4a is same as 4A
- It is allowed with or without 0x in the beginning.
- The minimum length of the secret is 128 bits and max 512 bits.
For example "4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a"
:return: The secret_hex of this PreSharedKey.
:rtype: str
"""
return self._secret_hex
@property
def created_at(self):
"""Gets the created_at of this PreSharedKey.
The date-time (RFC3339) when this pre-shared key was uploaded to Pelion Device Management.
:return: The created_at of this PreSharedKey.
:rtype: datetime
"""
return self._created_at
|
class PreSharedKey(BaseObject):
'''Describes device object from the catalog.
For more information about such keys,
have a look at
https://cloud.mbed.com/docs/latest/connecting/mbed-client-lite-security-considerations.html"
'''
@staticmethod
def _get_attributes_map():
pass
@property
def endpoint_name(self):
'''The endpoint_name of this PreSharedKey.
Endpoint name is the unique ID of the pre-shared key.
16-64 printable (non-control) ASCII characters.
It also must be globally unique.
Consider using vendor-MAC-ID-device-model.
For example "myEndpoint.host.com"
:param endpoint_name: The endpoint_name of this PreSharedKey.
:type: str
'''
pass
@property
def secret_hex(self):
'''The secret_hex of this PreSharedKey.
The secret of the pre-shared key in HEX format.
- It is not case sensitive; 4a is same as 4A
- It is allowed with or without 0x in the beginning.
- The minimum length of the secret is 128 bits and max 512 bits.
For example "4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a4a"
:return: The secret_hex of this PreSharedKey.
:rtype: str
'''
pass
@property
def created_at(self):
'''Gets the created_at of this PreSharedKey.
The date-time (RFC3339) when this pre-shared key was uploaded to Pelion Device Management.
:return: The created_at of this PreSharedKey.
:rtype: datetime
'''
pass
| 9 | 4 | 11 | 2 | 3 | 6 | 1 | 1.65 | 1 | 0 | 0 | 0 | 3 | 0 | 4 | 12 | 57 | 12 | 17 | 9 | 8 | 28 | 9 | 5 | 4 | 1 | 2 | 0 | 4 |
2,534 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/billing/billing.py
|
mbed_cloud.billing.billing.ServicePackage
|
class ServicePackage(BaseObject):
"""A billing package"""
@staticmethod
def _get_attributes_map():
return dict(
id='id',
created_at='created',
modified_at='modified',
starts_at='starts_time',
expires_at='expires',
ends_at='end_time',
grace_period='grace_period',
firmware_update_count='firmware_update_count',
reason='reason',
previous_id='previous_id',
next_id='next_id',
state='state',
)
@property
def id(self):
"""The id of this package"""
return self._id
@property
def created_at(self):
"""The creation datetime of this package"""
return self._created_at
@property
def modified_at(self):
"""The modification datetime of this package"""
return self._modified_at
@property
def starts_at(self):
"""The start datetime of this package"""
return self._starts_at
@property
def expires_at(self):
"""The expiry datetime of this package"""
return self._expires_at
@property
def ends_at(self):
"""The end datetime of this package"""
return self._ends_at
@property
def grace_period(self):
"""Period after package ending in which existing update campaigns continue to function"""
return self._grace_period
@property
def reason(self):
"""The reason for package ending"""
return self._reason
@property
def previous_id(self):
"""The previous package in the sequence"""
return self._previous_id
@property
def next_id(self):
"""The next package in the sequence"""
return self._next_id
@property
def firmware_update_count(self):
"""The firmware update count"""
return self._firmware_update_count
@property
def state(self):
"""The state"""
return self._state
|
class ServicePackage(BaseObject):
'''A billing package'''
@staticmethod
def _get_attributes_map():
pass
@property
def id(self):
'''The id of this package'''
pass
@property
def created_at(self):
'''The creation datetime of this package'''
pass
@property
def modified_at(self):
'''The modification datetime of this package'''
pass
@property
def starts_at(self):
'''The start datetime of this package'''
pass
@property
def expires_at(self):
'''The expiry datetime of this package'''
pass
@property
def ends_at(self):
'''The end datetime of this package'''
pass
@property
def grace_period(self):
'''Period after package ending in which existing update campaigns continue to function'''
pass
@property
def reason(self):
'''The reason for package ending'''
pass
@property
def previous_id(self):
'''The previous package in the sequence'''
pass
@property
def next_id(self):
'''The next package in the sequence'''
pass
@property
def firmware_update_count(self):
'''The firmware update count'''
pass
@property
def state(self):
'''The state'''
pass
| 27 | 13 | 4 | 0 | 3 | 1 | 1 | 0.25 | 1 | 1 | 0 | 0 | 12 | 0 | 13 | 21 | 79 | 13 | 53 | 27 | 26 | 13 | 27 | 14 | 13 | 1 | 2 | 0 | 13 |
2,535 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/billing/billing.py
|
mbed_cloud.billing.billing.QuotaHistory
|
class QuotaHistory(BaseObject):
"""An audit history entry for billing entities"""
@staticmethod
def _get_attributes_map():
return dict(
id='id',
created_at='added',
delta='amount',
reason='reason',
reservation='reservation',
service_package='service_package',
)
@property
def id(self):
"""The id of this QuotaHistory"""
return self._id
@property
def created_at(self):
"""The time this entry was created"""
return self._created_at
@property
def delta(self):
"""The change in remaining value, at the time this entry was created
Negative values mean the remaining amount has been reduced
for example, a reservation caused by starting a campaign
"""
return self._delta
@property
def reason(self):
"""The reason this entry was created"""
return self._reason
@property
def reservation(self):
"""The campaign reservation that this entry refers to"""
return self._reservation
@property
def service_package(self):
"""The service package that this entry refers to"""
return self._service_package
|
class QuotaHistory(BaseObject):
'''An audit history entry for billing entities'''
@staticmethod
def _get_attributes_map():
pass
@property
def id(self):
'''The id of this QuotaHistory'''
pass
@property
def created_at(self):
'''The time this entry was created'''
pass
@property
def delta(self):
'''The change in remaining value, at the time this entry was created
Negative values mean the remaining amount has been reduced
for example, a reservation caused by starting a campaign
'''
pass
@property
def reason(self):
'''The reason this entry was created'''
pass
@property
def reservation(self):
'''The campaign reservation that this entry refers to'''
pass
@property
def service_package(self):
'''The service package that this entry refers to'''
pass
| 15 | 7 | 4 | 0 | 3 | 1 | 1 | 0.34 | 1 | 1 | 0 | 0 | 6 | 0 | 7 | 15 | 47 | 8 | 29 | 15 | 14 | 10 | 15 | 8 | 7 | 1 | 2 | 0 | 7 |
2,536 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/account_management/account_management.py
|
mbed_cloud.account_management.account_management.User
|
class User(BaseObject):
"""Describes user object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Listing existing users
for idx, user in enumerate(api.list_users())
print(user.full_name)
# Creating a new user
new_user = api.add_user("username",
"user@example.org",
full_name = "David Bowie",
password = "hunter2")
"""
def __init__(self, dictionary):
"""Initialize object."""
super(User, self).__init__(dictionary)
login_history = getattr(self, 'login_history') or []
self._login_history = [LoginHistory(login) for login in login_history]
@staticmethod
def _get_attributes_map():
return {
"full_name": "full_name",
"username": "username",
"password": "password",
"email": "email",
"phone_number": "phone_number",
"address": "address",
"terms_accepted": "is_gtc_accepted",
"marketing_accepted": "is_marketing_accepted",
"groups": "groups",
"id": "id",
"status": "status",
"account_id": "account_id",
"email_verified": "email_verified",
"created_at": "created_at",
"creation_time": "creation_time",
"password_changed_time": "password_changed_time",
"last_login_time": "last_login_time",
"two_factor_authentication": "is_totp_enabled",
"login_history": "login_history",
}
@property
def full_name(self):
"""The full name of the user.
:rtype: str
"""
return self._full_name
@property
def username(self):
"""A username containing alphanumerical letters and -,._@+= characters.
:rtype: str
"""
return self._username
@property
def password(self):
"""The password when creating a new user. It will be generated when not present in the request.
:rtype: str
"""
return self._password
@property
def email(self):
"""The email address.
:rtype: str
"""
return self._email
@property
def phone_number(self):
"""Phone number.
:rtype: str
"""
return self._phone_number
@property
def address(self):
"""Address.
:rtype: str
"""
return self._address
@property
def terms_accepted(self):
"""A flag indicating that the General Terms and Conditions has been accepted.
:rtype: bool
"""
return self._terms_accepted
@property
def marketing_accepted(self):
"""A flag indicating that receiving marketing information has been accepted.
:rtype: bool
"""
return self._marketing_accepted
@property
def groups(self):
"""A list of group IDs this user belongs to (readonly).
:rtype: str[]
"""
return self._groups
@property
def id(self):
"""The UUID of the user (readonly).
:rtype: str
"""
return self._id
@property
def status(self):
"""The status of the user (readonly).
INVITED means that the user has not accepted the invitation request.
RESET means that the password must be changed immediately.
values: ENROLLING, INVITED, ACTIVE, RESET, INACTIVE
:rtype: str
"""
return self._status
@property
def account_id(self):
"""The UUID of the account (readonly).
:rtype: str
"""
return self._account_id
@property
def email_verified(self):
"""A flag indicating whether the user's email address has been verified or not.
:rtype: bool
"""
return self._email_verified
@property
def created_at(self):
"""Creation UTC time RFC3339 (readonly).
:rtype: datetime
"""
return self._created_at
@property
def creation_time(self):
"""A timestamp of the user creation in the storage, in milliseconds (readonly).
:rtype: int
"""
return self._creation_time
@property
def password_changed_time(self):
"""A timestamp of the latest change of the user password, in milliseconds (readonly).
:rtype: int
"""
return self._password_changed_time
@property
def last_login_time(self):
"""A timestamp of the latest login of the user, in milliseconds (readonly).
:rtype: int
"""
return self._last_login_time
@property
def two_factor_authentication(self):
"""Whether two factor authentication has been enabled for this user (readonly).
:rtype: bool
"""
return self._two_factor_authentication
@property
def login_history(self):
"""History of logins for this user (readonly).
:returns: List of LoginHistory.
:rtype: LoginHistory
"""
return self._login_history
|
class User(BaseObject):
'''Describes user object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Listing existing users
for idx, user in enumerate(api.list_users())
print(user.full_name)
# Creating a new user
new_user = api.add_user("username",
"user@example.org",
full_name = "David Bowie",
password = "hunter2")
'''
def __init__(self, dictionary):
'''Initialize object.'''
pass
@staticmethod
def _get_attributes_map():
pass
@property
def full_name(self):
'''The full name of the user.
:rtype: str
'''
pass
@property
def username(self):
'''A username containing alphanumerical letters and -,._@+= characters.
:rtype: str
'''
pass
@property
def password(self):
'''The password when creating a new user. It will be generated when not present in the request.
:rtype: str
'''
pass
@property
def email(self):
'''The email address.
:rtype: str
'''
pass
@property
def phone_number(self):
'''Phone number.
:rtype: str
'''
pass
@property
def address(self):
'''Address.
:rtype: str
'''
pass
@property
def terms_accepted(self):
'''A flag indicating that the General Terms and Conditions has been accepted.
:rtype: bool
'''
pass
@property
def marketing_accepted(self):
'''A flag indicating that receiving marketing information has been accepted.
:rtype: bool
'''
pass
@property
def groups(self):
'''A list of group IDs this user belongs to (readonly).
:rtype: str[]
'''
pass
@property
def id(self):
'''The UUID of the user (readonly).
:rtype: str
'''
pass
@property
def status(self):
'''The status of the user (readonly).
INVITED means that the user has not accepted the invitation request.
RESET means that the password must be changed immediately.
values: ENROLLING, INVITED, ACTIVE, RESET, INACTIVE
:rtype: str
'''
pass
@property
def account_id(self):
'''The UUID of the account (readonly).
:rtype: str
'''
pass
@property
def email_verified(self):
'''A flag indicating whether the user's email address has been verified or not.
:rtype: bool
'''
pass
@property
def created_at(self):
'''Creation UTC time RFC3339 (readonly).
:rtype: datetime
'''
pass
@property
def creation_time(self):
'''A timestamp of the user creation in the storage, in milliseconds (readonly).
:rtype: int
'''
pass
@property
def password_changed_time(self):
'''A timestamp of the latest change of the user password, in milliseconds (readonly).
:rtype: int
'''
pass
@property
def last_login_time(self):
'''A timestamp of the latest login of the user, in milliseconds (readonly).
:rtype: int
'''
pass
@property
def two_factor_authentication(self):
'''Whether two factor authentication has been enabled for this user (readonly).
:rtype: bool
'''
pass
@property
def login_history(self):
'''History of logins for this user (readonly).
:returns: List of LoginHistory.
:rtype: LoginHistory
'''
pass
| 42 | 21 | 7 | 1 | 3 | 3 | 1 | 0.88 | 1 | 2 | 1 | 0 | 20 | 1 | 21 | 29 | 206 | 46 | 85 | 44 | 43 | 75 | 45 | 24 | 23 | 1 | 2 | 0 | 21 |
2,537 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/update_campaign_gte_lte_filter.py
|
mbed_cloud._backends.update_service.models.update_campaign_gte_lte_filter.UpdateCampaignGteLteFilter
|
class UpdateCampaignGteLteFilter(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'etag': 'datetime',
'finished': 'datetime',
'started_at': 'datetime',
'updated_at': 'datetime',
'when': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'etag': 'etag',
'finished': 'finished',
'started_at': 'started_at',
'updated_at': 'updated_at',
'when': 'when'
}
def __init__(self, created_at=None, etag=None, finished=None, started_at=None, updated_at=None, when=None):
"""
UpdateCampaignGteLteFilter - a model defined in Swagger
"""
self._created_at = created_at
self._etag = etag
self._finished = finished
self._started_at = started_at
self._updated_at = updated_at
self._when = when
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this UpdateCampaignGteLteFilter.
:return: The created_at of this UpdateCampaignGteLteFilter.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this UpdateCampaignGteLteFilter.
:param created_at: The created_at of this UpdateCampaignGteLteFilter.
:type: datetime
"""
self._created_at = created_at
@property
def etag(self):
"""
Gets the etag of this UpdateCampaignGteLteFilter.
:return: The etag of this UpdateCampaignGteLteFilter.
:rtype: datetime
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this UpdateCampaignGteLteFilter.
:param etag: The etag of this UpdateCampaignGteLteFilter.
:type: datetime
"""
self._etag = etag
@property
def finished(self):
"""
Gets the finished of this UpdateCampaignGteLteFilter.
:return: The finished of this UpdateCampaignGteLteFilter.
:rtype: datetime
"""
return self._finished
@finished.setter
def finished(self, finished):
"""
Sets the finished of this UpdateCampaignGteLteFilter.
:param finished: The finished of this UpdateCampaignGteLteFilter.
:type: datetime
"""
self._finished = finished
@property
def started_at(self):
"""
Gets the started_at of this UpdateCampaignGteLteFilter.
:return: The started_at of this UpdateCampaignGteLteFilter.
:rtype: datetime
"""
return self._started_at
@started_at.setter
def started_at(self, started_at):
"""
Sets the started_at of this UpdateCampaignGteLteFilter.
:param started_at: The started_at of this UpdateCampaignGteLteFilter.
:type: datetime
"""
self._started_at = started_at
@property
def updated_at(self):
"""
Gets the updated_at of this UpdateCampaignGteLteFilter.
:return: The updated_at of this UpdateCampaignGteLteFilter.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this UpdateCampaignGteLteFilter.
:param updated_at: The updated_at of this UpdateCampaignGteLteFilter.
:type: datetime
"""
self._updated_at = updated_at
@property
def when(self):
"""
Gets the when of this UpdateCampaignGteLteFilter.
:return: The when of this UpdateCampaignGteLteFilter.
:rtype: datetime
"""
return self._when
@when.setter
def when(self, when):
"""
Sets the when of this UpdateCampaignGteLteFilter.
:param when: The when of this UpdateCampaignGteLteFilter.
:type: datetime
"""
self._when = when
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdateCampaignGteLteFilter):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdateCampaignGteLteFilter(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, etag=None, finished=None, started_at=None, updated_at=None, when=None):
'''
UpdateCampaignGteLteFilter - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this UpdateCampaignGteLteFilter.
:return: The created_at of this UpdateCampaignGteLteFilter.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this UpdateCampaignGteLteFilter.
:param created_at: The created_at of this UpdateCampaignGteLteFilter.
:type: datetime
'''
pass
@property
def etag(self):
'''
Gets the etag of this UpdateCampaignGteLteFilter.
:return: The etag of this UpdateCampaignGteLteFilter.
:rtype: datetime
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this UpdateCampaignGteLteFilter.
:param etag: The etag of this UpdateCampaignGteLteFilter.
:type: datetime
'''
pass
@property
def finished(self):
'''
Gets the finished of this UpdateCampaignGteLteFilter.
:return: The finished of this UpdateCampaignGteLteFilter.
:rtype: datetime
'''
pass
@finished.setter
def finished(self):
'''
Sets the finished of this UpdateCampaignGteLteFilter.
:param finished: The finished of this UpdateCampaignGteLteFilter.
:type: datetime
'''
pass
@property
def started_at(self):
'''
Gets the started_at of this UpdateCampaignGteLteFilter.
:return: The started_at of this UpdateCampaignGteLteFilter.
:rtype: datetime
'''
pass
@started_at.setter
def started_at(self):
'''
Sets the started_at of this UpdateCampaignGteLteFilter.
:param started_at: The started_at of this UpdateCampaignGteLteFilter.
:type: datetime
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this UpdateCampaignGteLteFilter.
:return: The updated_at of this UpdateCampaignGteLteFilter.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this UpdateCampaignGteLteFilter.
:param updated_at: The updated_at of this UpdateCampaignGteLteFilter.
:type: datetime
'''
pass
@property
def when(self):
'''
Gets the when of this UpdateCampaignGteLteFilter.
:return: The when of this UpdateCampaignGteLteFilter.
:rtype: datetime
'''
pass
@when.setter
def when(self):
'''
Sets the when of this UpdateCampaignGteLteFilter.
:param when: The when of this UpdateCampaignGteLteFilter.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 31 | 19 | 9 | 1 | 3 | 4 | 1 | 0.98 | 1 | 3 | 0 | 0 | 18 | 7 | 18 | 18 | 223 | 43 | 91 | 43 | 60 | 89 | 55 | 31 | 36 | 5 | 1 | 2 | 23 |
2,538 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/account_management/account_management.py
|
mbed_cloud.account_management.account_management.LoginHistory
|
class LoginHistory(BaseObject):
"""Login History."""
@staticmethod
def _get_attributes_map():
return {
"date": "date",
"user_agent": "user_agent",
"ip_address": "ip_address",
"success": "success"
}
@property
def date(self):
"""Date of login.
:rtype: datetime
"""
return self._date
@property
def user_agent(self):
"""User agent used for login.
:rtype: str
"""
return self._user_agent
@property
def ip_address(self):
"""IP Address login from.
:rtype: str
"""
return self._ip_address
@property
def success(self):
"""Whether login was successful.
:rtype: bool
"""
return self._success
|
class LoginHistory(BaseObject):
'''Login History.'''
@staticmethod
def _get_attributes_map():
pass
@property
def date(self):
'''Date of login.
:rtype: datetime
'''
pass
@property
def user_agent(self):
'''User agent used for login.
:rtype: str
'''
pass
@property
def ip_address(self):
'''IP Address login from.
:rtype: str
'''
pass
@property
def success(self):
'''Whether login was successful.
:rtype: bool
'''
pass
| 11 | 5 | 6 | 1 | 3 | 2 | 1 | 0.62 | 1 | 0 | 0 | 0 | 4 | 0 | 5 | 13 | 43 | 9 | 21 | 11 | 10 | 13 | 11 | 6 | 5 | 1 | 2 | 0 | 5 |
2,539 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/account_management/account_management.py
|
mbed_cloud.account_management.account_management.ApiKey
|
class ApiKey(BaseObject):
"""Describes API key object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Listing existing keys
for idx, k in enumerate(api.list_api_keys()):
print(k.name, k.key)
# Creating a new key
new_k = api.add_api_key("New key name")
print(new_k.key)
"""
@staticmethod
def _get_attributes_map():
return {
"name": "name",
"owner_id": "owner",
"groups": "groups",
"id": "id",
"key": "key",
"status": "status",
"created_at": "created_at",
"creation_time": "creation_time",
"last_login_time": "last_login_time"
}
@property
def name(self):
"""The display name for the API key.
:rtype: str
"""
return self._name
@property
def owner_id(self):
"""The owner of this API key, who is the creator by default.
:rtype: str
"""
return self._owner_id
@property
def groups(self):
"""A list of group IDs this API key belongs to.
:rtype: str[]
"""
return self._groups
@property
def id(self):
"""The UUID of the API key. (readonly)
:rtype: str
"""
return self._id
@property
def key(self):
"""The API key. (readonly)
:rtype: str
"""
return self._key
@property
def status(self):
"""The status of the API key. (readonly)
values: ACTIVE, INACTIVE
:rtype: str
"""
return self._status
@property
def created_at(self):
"""Creation UTC time RFC3339. (readonly)
:rtype: datetime
"""
return self._created_at
@property
def creation_time(self):
"""The timestamp of the API key creation in the storage, in milliseconds. (readonly)
:rtype: int
"""
return self._creation_time
@property
def last_login_time(self):
"""The timestamp of the latest API key usage, in milliseconds. (readonly)
:rtype: int
"""
return self._last_login_time
|
class ApiKey(BaseObject):
'''Describes API key object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Listing existing keys
for idx, k in enumerate(api.list_api_keys()):
print(k.name, k.key)
# Creating a new key
new_k = api.add_api_key("New key name")
print(new_k.key)
'''
@staticmethod
def _get_attributes_map():
pass
@property
def name(self):
'''The display name for the API key.
:rtype: str
'''
pass
@property
def owner_id(self):
'''The owner of this API key, who is the creator by default.
:rtype: str
'''
pass
@property
def groups(self):
'''A list of group IDs this API key belongs to.
:rtype: str[]
'''
pass
@property
def id(self):
'''The UUID of the API key. (readonly)
:rtype: str
'''
pass
@property
def key(self):
'''The API key. (readonly)
:rtype: str
'''
pass
@property
def status(self):
'''The status of the API key. (readonly)
values: ACTIVE, INACTIVE
:rtype: str
'''
pass
@property
def created_at(self):
'''Creation UTC time RFC3339. (readonly)
:rtype: datetime
'''
pass
@property
def creation_time(self):
'''The timestamp of the API key creation in the storage, in milliseconds. (readonly)
:rtype: int
'''
pass
@property
def last_login_time(self):
'''The timestamp of the latest API key usage, in milliseconds. (readonly)
:rtype: int
'''
pass
| 21 | 10 | 7 | 1 | 3 | 3 | 1 | 0.95 | 1 | 0 | 0 | 0 | 9 | 0 | 10 | 18 | 105 | 25 | 41 | 21 | 20 | 39 | 21 | 11 | 10 | 1 | 2 | 0 | 10 |
2,540 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/account_management/account_management.py
|
mbed_cloud.account_management.account_management.Account
|
class Account(BaseObject):
"""Describes account object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Get account owning the API key in use
current_account = api.get_account()
print(current_account.company)
"""
@staticmethod
def _get_attributes_map():
return {
"display_name": "display_name",
"aliases": "aliases",
"company": "company",
"contact": "contact",
"email": "email",
"phone_number": "phone_number",
"address_line1": "address_line1",
"address_line2": "address_line2",
"city": "city",
"state": "state",
"postcode": "postal_code",
"country": "country",
"id": "id",
"status": "status",
"tier": "tier",
"limits": "limits",
"policies": "policies",
"provisioning_allowed": "is_provisioning_allowed",
"created_at": "created_at",
"upgraded_at": "upgraded_at",
"updated_at": "updated_at",
"reason": "reason",
"template_id": "template_id",
"sales_contact_email": "sales_contact",
"contract_number": "contract_number",
"customer_number": "customer_number",
"reference_note": "reference_note",
"notification_emails": "notification_emails",
"multifactor_authentication_status": "mfa_status",
"expiry_warning": "expiration_warning_threshold",
}
@property
def display_name(self):
"""The display name for the account.
:rtype: str
"""
return self._display_name
@property
def aliases(self):
"""An array of aliases.
:rtype: str[]
"""
return self._aliases
@property
def company(self):
"""The name of the company.
:rtype: str
"""
return self._company
@property
def contact(self):
"""The name of the contact person for this account.
:rtype: str
"""
return self._contact
@property
def email(self):
"""The company email address for this account.
:rtype: str
"""
return self._email
@property
def phone_number(self):
"""The phone number of the company.
:rtype: str
"""
return self._phone_number
@property
def address_line1(self):
"""Postal address line 1.
:rtype: str
"""
return self._address_line1
@property
def address_line2(self):
"""Postal address line 2.
:rtype: str
"""
return self._address_line2
@property
def city(self):
"""The city part of the postal address.
:rtype: str
"""
return self._city
@property
def state(self):
"""The state part of the postal address.
:rtype: str
"""
return self._state
@property
def postcode(self):
"""The postal code part of the postal address.
:rtype: str
"""
return self._postcode
@property
def country(self):
"""The country part of the postal address.
:rtype: str
"""
return self._country
@property
def id(self):
"""Account ID (readonly).
:rtype: str
"""
return self._id
@property
def status(self):
"""The status of the account.
values: ENROLLING, ACTIVE, RESTRICTED, SUSPENDED
:rtype: str
"""
return self._status
@property
def tier(self):
"""The tier level of the account; '0': free tier, '1': commercial account.
Other values are reserved for the future.
:rtype: str
"""
return self._tier
@property
def limits(self):
"""List of limits as key-value pairs if requested.
:rtype: list of Limits
"""
return self._limits
@property
def policies(self):
"""List of policies if requested.
:rtype: list of Policies
"""
return self._policies
@property
def provisioning_allowed(self):
"""Flag (true/false) indicating whether Factory Tool is allowed to download or not.
:rtype: bool
"""
return self._provisioning_allowed
@property
def created_at(self):
"""Creation UTC time RFC3339.
:rtype: datetime
"""
return self._created_at
@property
def upgraded_at(self):
"""Time when upgraded to commercial account in UTC format RFC3339.
:rtype: datetime
"""
return self._upgraded_at
@property
def reason(self):
"""A note about the reason for updating the status of the account.
:rtype: str
"""
return self._reason
@property
def template_id(self):
"""Account template ID.
:rtype: str
"""
return self._template_id
@property
def contract_number(self):
"""Gets the contract_number of this AccountInfo.
Contract number of the customer.
:return: The contract_number of this AccountInfo.
:rtype: str
"""
return self._contract_number
@property
def customer_number(self):
"""Gets the customer_number of this AccountInfo.
Customer number of the customer.
:return: The customer_number of this AccountInfo.
:rtype: str
"""
return self._customer_number
@property
def reference_note(self):
"""Gets the reference_note of this AccountInfo.
A reference note for updating the status of the account
:return: The reference_note of this AccountInfo.
:rtype: str
"""
return self._reference_note
@property
def notification_emails(self):
"""Gets the notification_emails of this AccountInfo.
A list of notification email addresses.
:return: The notification_emails of this AccountInfo.
:rtype: list[str]
"""
return self._notification_emails
@property
def sales_contact_email(self):
"""Gets the sales_contact_email of this AccountInfo.
Email address of the sales contact.
:return: The sales_contact_email of this AccountInfo.
:rtype: str
"""
return self._sales_contact_email
@property
def multifactor_authentication_status(self):
"""Gets the multifactor_authentication_status of this AccountInfo.
The enforcement status of the multi-factor authentication, either 'enforced' or 'optional'.
:return: The mfa_status of this AccountInfo.
:rtype: str
"""
return self._multifactor_authentication_status
@property
def expiry_warning(self):
"""Gets the expiry_warning of this AccountInfo.
Indicates how many days (1-180) before account expiration
a notification email should be sent.
:return: The expiration_warning_threshold of this AccountInfo.
:rtype: str
"""
return self._expiry_warning
@property
def updated_at(self):
"""Gets the updated_at of this AccountInfo.
Last update UTC time RFC3339.
:return: The updated_at of this AccountInfo.
:rtype: datetime
"""
return self._updated_at
|
class Account(BaseObject):
'''Describes account object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Get account owning the API key in use
current_account = api.get_account()
print(current_account.company)
'''
@staticmethod
def _get_attributes_map():
pass
@property
def display_name(self):
'''The display name for the account.
:rtype: str
'''
pass
@property
def aliases(self):
'''An array of aliases.
:rtype: str[]
'''
pass
@property
def company(self):
'''The name of the company.
:rtype: str
'''
pass
@property
def contact(self):
'''The name of the contact person for this account.
:rtype: str
'''
pass
@property
def email(self):
'''The company email address for this account.
:rtype: str
'''
pass
@property
def phone_number(self):
'''The phone number of the company.
:rtype: str
'''
pass
@property
def address_line1(self):
'''Postal address line 1.
:rtype: str
'''
pass
@property
def address_line2(self):
'''Postal address line 2.
:rtype: str
'''
pass
@property
def city(self):
'''The city part of the postal address.
:rtype: str
'''
pass
@property
def state(self):
'''The state part of the postal address.
:rtype: str
'''
pass
@property
def postcode(self):
'''The postal code part of the postal address.
:rtype: str
'''
pass
@property
def country(self):
'''The country part of the postal address.
:rtype: str
'''
pass
@property
def id(self):
'''Account ID (readonly).
:rtype: str
'''
pass
@property
def status(self):
'''The status of the account.
values: ENROLLING, ACTIVE, RESTRICTED, SUSPENDED
:rtype: str
'''
pass
@property
def tier(self):
'''The tier level of the account; '0': free tier, '1': commercial account.
Other values are reserved for the future.
:rtype: str
'''
pass
@property
def limits(self):
'''List of limits as key-value pairs if requested.
:rtype: list of Limits
'''
pass
@property
def policies(self):
'''List of policies if requested.
:rtype: list of Policies
'''
pass
@property
def provisioning_allowed(self):
'''Flag (true/false) indicating whether Factory Tool is allowed to download or not.
:rtype: bool
'''
pass
@property
def created_at(self):
'''Creation UTC time RFC3339.
:rtype: datetime
'''
pass
@property
def upgraded_at(self):
'''Time when upgraded to commercial account in UTC format RFC3339.
:rtype: datetime
'''
pass
@property
def reason(self):
'''A note about the reason for updating the status of the account.
:rtype: str
'''
pass
@property
def template_id(self):
'''Account template ID.
:rtype: str
'''
pass
@property
def contract_number(self):
'''Gets the contract_number of this AccountInfo.
Contract number of the customer.
:return: The contract_number of this AccountInfo.
:rtype: str
'''
pass
@property
def customer_number(self):
'''Gets the customer_number of this AccountInfo.
Customer number of the customer.
:return: The customer_number of this AccountInfo.
:rtype: str
'''
pass
@property
def reference_note(self):
'''Gets the reference_note of this AccountInfo.
A reference note for updating the status of the account
:return: The reference_note of this AccountInfo.
:rtype: str
'''
pass
@property
def notification_emails(self):
'''Gets the notification_emails of this AccountInfo.
A list of notification email addresses.
:return: The notification_emails of this AccountInfo.
:rtype: list[str]
'''
pass
@property
def sales_contact_email(self):
'''Gets the sales_contact_email of this AccountInfo.
Email address of the sales contact.
:return: The sales_contact_email of this AccountInfo.
:rtype: str
'''
pass
@property
def multifactor_authentication_status(self):
'''Gets the multifactor_authentication_status of this AccountInfo.
The enforcement status of the multi-factor authentication, either 'enforced' or 'optional'.
:return: The mfa_status of this AccountInfo.
:rtype: str
'''
pass
@property
def expiry_warning(self):
'''Gets the expiry_warning of this AccountInfo.
Indicates how many days (1-180) before account expiration
a notification email should be sent.
:return: The expiration_warning_threshold of this AccountInfo.
:rtype: str
'''
pass
@property
def updated_at(self):
'''Gets the updated_at of this AccountInfo.
Last update UTC time RFC3339.
:return: The updated_at of this AccountInfo.
:rtype: datetime
'''
pass
| 63 | 31 | 8 | 1 | 3 | 4 | 1 | 0.94 | 1 | 0 | 0 | 0 | 30 | 0 | 31 | 39 | 317 | 75 | 125 | 63 | 62 | 117 | 63 | 32 | 31 | 1 | 2 | 0 | 31 |
2,541 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/rest.py
|
mbed_cloud._backends.update_service.rest.RESTClientObject
|
class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=None):
# urllib3.PoolManager will pass all kw parameters to connectionpool
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680
# maxsize is the number of requests to host that are allowed in parallel
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html
# cert_reqs
if configuration.verify_ssl:
cert_reqs = ssl.CERT_REQUIRED
else:
cert_reqs = ssl.CERT_NONE
# ca_certs
if configuration.ssl_ca_cert:
ca_certs = configuration.ssl_ca_cert
else:
# if not set certificate file, use Mozilla's root certificates.
ca_certs = certifi.where()
addition_pool_args = {}
if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = configuration.assert_hostname
if maxsize is None:
if configuration.connection_pool_maxsize is not None:
maxsize = configuration.connection_pool_maxsize
else:
maxsize = 4
# https pool manager
if configuration.proxy:
self.pool_manager = urllib3.ProxyManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
proxy_url=configuration.proxy,
**addition_pool_args
)
else:
self.pool_manager = urllib3.PoolManager(
num_pools=pools_size,
maxsize=maxsize,
cert_reqs=cert_reqs,
ca_certs=ca_certs,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
**addition_pool_args
)
def request(self, method, url, query_params=None, headers=None,
body=None, post_params=None, _preload_content=True, _request_timeout=None):
"""
:param method: http request method
:param url: http request url
:param query_params: query parameters in the url
:param headers: http request headers
:param body: request json body, for `application/json`
:param post_params: request post parameters,
`application/x-www-form-urlencoded`
and `multipart/form-data`
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without
reading/decoding response data. Default is True.
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request
timeout. It can also be a pair (tuple) of (connection, read) timeouts.
"""
method = method.upper()
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', 'PATCH', 'OPTIONS']
if post_params and body:
raise ValueError(
"body parameter cannot be used with post_params parameter."
)
post_params = post_params or {}
headers = headers or {}
timeout = None
if _request_timeout:
if isinstance(_request_timeout, (int, ) if PY3 else (int, long)):
timeout = urllib3.Timeout(total=_request_timeout)
elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2:
timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1])
if 'Content-Type' not in headers:
headers['Content-Type'] = 'application/json'
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
if query_params:
url += '?' + urlencode(query_params)
if re.search('json', headers['Content-Type'], re.IGNORECASE):
request_body = None
########### Change
if body is not None:
if isinstance(body, string_types):
request_body = body
else:
request_body = json.dumps(body)
########### End Change
r = self.pool_manager.request(method, url,
body=request_body,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
r = self.pool_manager.request(method, url,
fields=post_params,
encode_multipart=False,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
elif headers['Content-Type'] == 'multipart/form-data':
# must del headers['Content-Type'], or the correct Content-Type
# which generated by urllib3 will be overwritten.
del headers['Content-Type']
r = self.pool_manager.request(method, url,
fields=post_params,
encode_multipart=True,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
# Pass a `string` parameter directly in the body to support
# other content types than Json when `body` argument is provided
# in serialized form
elif isinstance(body, str):
request_body = body
r = self.pool_manager.request(method, url,
body=request_body,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
else:
# Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided arguments.
Please check that your arguments match declared content type."""
raise ApiException(status=0, reason=msg)
# For `GET`, `HEAD`
else:
r = self.pool_manager.request(method, url,
fields=query_params,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
except urllib3.exceptions.SSLError as e:
msg = "{0}\n{1}".format(type(e).__name__, str(e))
raise ApiException(status=0, reason=msg)
if _preload_content:
r = RESTResponse(r)
# In the python 3, the response.data is bytes.
# we need to decode it to string.
if PY3:
r.data = r.data.decode('utf8')
# log response body
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
raise ApiException(http_resp=r)
return r
def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
return self.request("GET", url,
headers=headers,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
query_params=query_params)
def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
return self.request("HEAD", url,
headers=headers,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
query_params=query_params)
def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return self.request("OPTIONS", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None):
return self.request("DELETE", url,
headers=headers,
query_params=query_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return self.request("POST", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return self.request("PUT", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
return self.request("PATCH", url,
headers=headers,
query_params=query_params,
post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
body=body)
|
class RESTClientObject(object):
def __init__(self, configuration, pools_size=4, maxsize=None):
pass
def request(self, method, url, query_params=None, headers=None,
body=None, post_params=None, _preload_content=True, _request_timeout=None):
'''
:param method: http request method
:param url: http request url
:param query_params: query parameters in the url
:param headers: http request headers
:param body: request json body, for `application/json`
:param post_params: request post parameters,
`application/x-www-form-urlencoded`
and `multipart/form-data`
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without
reading/decoding response data. Default is True.
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request
timeout. It can also be a pair (tuple) of (connection, read) timeouts.
'''
pass
def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
pass
def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
pass
def OPTIONS(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
pass
def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None):
pass
def POST(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
pass
def PUT(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
pass
def PATCH(self, url, headers=None, query_params=None, post_params=None, body=None, _preload_content=True,
_request_timeout=None):
pass
| 10 | 1 | 25 | 2 | 19 | 4 | 4 | 0.21 | 1 | 11 | 2 | 0 | 9 | 1 | 9 | 9 | 231 | 24 | 171 | 24 | 156 | 36 | 76 | 18 | 66 | 19 | 1 | 5 | 33 |
2,542 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/upload_job_page.py
|
mbed_cloud._backends.update_service.models.upload_job_page.UploadJobPage
|
class UploadJobPage(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[UploadJob]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
UploadJobPage - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this UploadJobPage.
:return: The after of this UploadJobPage.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this UploadJobPage.
:param after: The after of this UploadJobPage.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this UploadJobPage.
:return: The data of this UploadJobPage.
:rtype: list[UploadJob]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this UploadJobPage.
:param data: The data of this UploadJobPage.
:type: list[UploadJob]
"""
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this UploadJobPage.
:return: The has_more of this UploadJobPage.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this UploadJobPage.
:param has_more: The has_more of this UploadJobPage.
:type: bool
"""
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this UploadJobPage.
:return: The limit of this UploadJobPage.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this UploadJobPage.
:param limit: The limit of this UploadJobPage.
:type: int
"""
self._limit = limit
@property
def object(self):
"""
Gets the object of this UploadJobPage.
:return: The object of this UploadJobPage.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UploadJobPage.
:param object: The object of this UploadJobPage.
:type: str
"""
self._object = object
@property
def order(self):
"""
Gets the order of this UploadJobPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this UploadJobPage.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this UploadJobPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this UploadJobPage.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this UploadJobPage.
:return: The total_count of this UploadJobPage.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this UploadJobPage.
:param total_count: The total_count of this UploadJobPage.
:type: int
"""
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UploadJobPage):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UploadJobPage(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
UploadJobPage - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this UploadJobPage.
:return: The after of this UploadJobPage.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this UploadJobPage.
:param after: The after of this UploadJobPage.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this UploadJobPage.
:return: The data of this UploadJobPage.
:rtype: list[UploadJob]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this UploadJobPage.
:param data: The data of this UploadJobPage.
:type: list[UploadJob]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this UploadJobPage.
:return: The has_more of this UploadJobPage.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this UploadJobPage.
:param has_more: The has_more of this UploadJobPage.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this UploadJobPage.
:return: The limit of this UploadJobPage.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this UploadJobPage.
:param limit: The limit of this UploadJobPage.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this UploadJobPage.
:return: The object of this UploadJobPage.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UploadJobPage.
:param object: The object of this UploadJobPage.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this UploadJobPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this UploadJobPage.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this UploadJobPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this UploadJobPage.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this UploadJobPage.
:return: The total_count of this UploadJobPage.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this UploadJobPage.
:param total_count: The total_count of this UploadJobPage.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 9 | 1 | 4 | 5 | 1 | 0.95 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 255 | 48 | 106 | 49 | 71 | 101 | 63 | 35 | 42 | 5 | 1 | 2 | 26 |
2,543 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/upload_job_1.py
|
mbed_cloud._backends.update_service.models.upload_job_1.UploadJob1
|
class UploadJob1(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'description': 'str',
'name': 'str'
}
attribute_map = {
'description': 'description',
'name': 'name'
}
def __init__(self, description=None, name=None):
"""
UploadJob1 - a model defined in Swagger
"""
self._description = description
self._name = name
self.discriminator = None
@property
def description(self):
"""
Gets the description of this UploadJob1.
Human-readable description
:return: The description of this UploadJob1.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this UploadJob1.
Human-readable description
:param description: The description of this UploadJob1.
:type: str
"""
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def name(self):
"""
Gets the name of this UploadJob1.
Human-readable name
:return: The name of this UploadJob1.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this UploadJob1.
Human-readable name
:param name: The name of this UploadJob1.
:type: str
"""
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UploadJob1):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UploadJob1(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, description=None, name=None):
'''
UploadJob1 - a model defined in Swagger
'''
pass
@property
def description(self):
'''
Gets the description of this UploadJob1.
Human-readable description
:return: The description of this UploadJob1.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this UploadJob1.
Human-readable description
:param description: The description of this UploadJob1.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this UploadJob1.
Human-readable name
:return: The name of this UploadJob1.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this UploadJob1.
Human-readable name
:param name: The name of this UploadJob1.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 15 | 11 | 10 | 1 | 5 | 4 | 2 | 0.9 | 1 | 4 | 0 | 0 | 10 | 3 | 10 | 10 | 135 | 23 | 59 | 23 | 44 | 53 | 39 | 19 | 28 | 5 | 1 | 2 | 17 |
2,544 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/upload_job.py
|
mbed_cloud._backends.update_service.models.upload_job.UploadJob
|
class UploadJob(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'description': 'str',
'name': 'str'
}
attribute_map = {
'description': 'description',
'name': 'name'
}
def __init__(self, description=None, name=None):
"""
UploadJob - a model defined in Swagger
"""
self._description = description
self._name = name
self.discriminator = None
@property
def description(self):
"""
Gets the description of this UploadJob.
Human-readable description
:return: The description of this UploadJob.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this UploadJob.
Human-readable description
:param description: The description of this UploadJob.
:type: str
"""
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def name(self):
"""
Gets the name of this UploadJob.
Human-readable name
:return: The name of this UploadJob.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this UploadJob.
Human-readable name
:param name: The name of this UploadJob.
:type: str
"""
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UploadJob):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UploadJob(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, description=None, name=None):
'''
UploadJob - a model defined in Swagger
'''
pass
@property
def description(self):
'''
Gets the description of this UploadJob.
Human-readable description
:return: The description of this UploadJob.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this UploadJob.
Human-readable description
:param description: The description of this UploadJob.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this UploadJob.
Human-readable name
:return: The name of this UploadJob.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this UploadJob.
Human-readable name
:param name: The name of this UploadJob.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 15 | 11 | 10 | 1 | 5 | 4 | 2 | 0.9 | 1 | 4 | 0 | 0 | 10 | 3 | 10 | 10 | 135 | 23 | 59 | 23 | 44 | 53 | 39 | 19 | 28 | 5 | 1 | 2 | 17 |
2,545 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/upload_chunk_info_page.py
|
mbed_cloud._backends.update_service.models.upload_chunk_info_page.UploadChunkInfoPage
|
class UploadChunkInfoPage(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[UploadChunkInfo]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
UploadChunkInfoPage - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this UploadChunkInfoPage.
:return: The after of this UploadChunkInfoPage.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this UploadChunkInfoPage.
:param after: The after of this UploadChunkInfoPage.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this UploadChunkInfoPage.
:return: The data of this UploadChunkInfoPage.
:rtype: list[UploadChunkInfo]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this UploadChunkInfoPage.
:param data: The data of this UploadChunkInfoPage.
:type: list[UploadChunkInfo]
"""
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this UploadChunkInfoPage.
:return: The has_more of this UploadChunkInfoPage.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this UploadChunkInfoPage.
:param has_more: The has_more of this UploadChunkInfoPage.
:type: bool
"""
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this UploadChunkInfoPage.
:return: The limit of this UploadChunkInfoPage.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this UploadChunkInfoPage.
:param limit: The limit of this UploadChunkInfoPage.
:type: int
"""
self._limit = limit
@property
def object(self):
"""
Gets the object of this UploadChunkInfoPage.
:return: The object of this UploadChunkInfoPage.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UploadChunkInfoPage.
:param object: The object of this UploadChunkInfoPage.
:type: str
"""
self._object = object
@property
def order(self):
"""
Gets the order of this UploadChunkInfoPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this UploadChunkInfoPage.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this UploadChunkInfoPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this UploadChunkInfoPage.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this UploadChunkInfoPage.
:return: The total_count of this UploadChunkInfoPage.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this UploadChunkInfoPage.
:param total_count: The total_count of this UploadChunkInfoPage.
:type: int
"""
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UploadChunkInfoPage):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UploadChunkInfoPage(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
UploadChunkInfoPage - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this UploadChunkInfoPage.
:return: The after of this UploadChunkInfoPage.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this UploadChunkInfoPage.
:param after: The after of this UploadChunkInfoPage.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this UploadChunkInfoPage.
:return: The data of this UploadChunkInfoPage.
:rtype: list[UploadChunkInfo]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this UploadChunkInfoPage.
:param data: The data of this UploadChunkInfoPage.
:type: list[UploadChunkInfo]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this UploadChunkInfoPage.
:return: The has_more of this UploadChunkInfoPage.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this UploadChunkInfoPage.
:param has_more: The has_more of this UploadChunkInfoPage.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this UploadChunkInfoPage.
:return: The limit of this UploadChunkInfoPage.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this UploadChunkInfoPage.
:param limit: The limit of this UploadChunkInfoPage.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this UploadChunkInfoPage.
:return: The object of this UploadChunkInfoPage.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UploadChunkInfoPage.
:param object: The object of this UploadChunkInfoPage.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this UploadChunkInfoPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this UploadChunkInfoPage.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this UploadChunkInfoPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this UploadChunkInfoPage.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this UploadChunkInfoPage.
:return: The total_count of this UploadChunkInfoPage.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this UploadChunkInfoPage.
:param total_count: The total_count of this UploadChunkInfoPage.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 9 | 1 | 4 | 5 | 1 | 0.95 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 255 | 48 | 106 | 49 | 71 | 101 | 63 | 35 | 42 | 5 | 1 | 2 | 26 |
2,546 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/upload_chunk_info.py
|
mbed_cloud._backends.update_service.models.upload_chunk_info.UploadChunkInfo
|
class UploadChunkInfo(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'etag': 'str',
'hash': 'str',
'id': 'int',
'length': 'int',
'object': 'str',
'status': 'str',
'updated_at': 'datetime'
}
attribute_map = {
'created_at': 'created_at',
'etag': 'etag',
'hash': 'hash',
'id': 'id',
'length': 'length',
'object': 'object',
'status': 'status',
'updated_at': 'updated_at'
}
def __init__(self, created_at=None, etag=None, hash=None, id=None, length=None, object=None, status=None, updated_at=None):
"""
UploadChunkInfo - a model defined in Swagger
"""
self._created_at = created_at
self._etag = etag
self._hash = hash
self._id = id
self._length = length
self._object = object
self._status = status
self._updated_at = updated_at
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this UploadChunkInfo.
The time the entity was created
:return: The created_at of this UploadChunkInfo.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this UploadChunkInfo.
The time the entity was created
:param created_at: The created_at of this UploadChunkInfo.
:type: datetime
"""
self._created_at = created_at
@property
def etag(self):
"""
Gets the etag of this UploadChunkInfo.
API resource entity version
:return: The etag of this UploadChunkInfo.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this UploadChunkInfo.
API resource entity version
:param etag: The etag of this UploadChunkInfo.
:type: str
"""
self._etag = etag
@property
def hash(self):
"""
Gets the hash of this UploadChunkInfo.
The hash of the chunk. The default hash is MD5. If no Content-MD5 header is supplied as part of uploading the chunk then this will be empty.
:return: The hash of this UploadChunkInfo.
:rtype: str
"""
return self._hash
@hash.setter
def hash(self, hash):
"""
Sets the hash of this UploadChunkInfo.
The hash of the chunk. The default hash is MD5. If no Content-MD5 header is supplied as part of uploading the chunk then this will be empty.
:param hash: The hash of this UploadChunkInfo.
:type: str
"""
self._hash = hash
@property
def id(self):
"""
Gets the id of this UploadChunkInfo.
The chunk number
:return: The id of this UploadChunkInfo.
:rtype: int
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this UploadChunkInfo.
The chunk number
:param id: The id of this UploadChunkInfo.
:type: int
"""
self._id = id
@property
def length(self):
"""
Gets the length of this UploadChunkInfo.
The length of the chunk
:return: The length of this UploadChunkInfo.
:rtype: int
"""
return self._length
@length.setter
def length(self, length):
"""
Sets the length of this UploadChunkInfo.
The length of the chunk
:param length: The length of this UploadChunkInfo.
:type: int
"""
self._length = length
@property
def object(self):
"""
Gets the object of this UploadChunkInfo.
Entity name: always 'upload-info'
:return: The object of this UploadChunkInfo.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UploadChunkInfo.
Entity name: always 'upload-info'
:param object: The object of this UploadChunkInfo.
:type: str
"""
self._object = object
@property
def status(self):
"""
Gets the status of this UploadChunkInfo.
The upload status of this chunk
:return: The status of this UploadChunkInfo.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this UploadChunkInfo.
The upload status of this chunk
:param status: The status of this UploadChunkInfo.
:type: str
"""
self._status = status
@property
def updated_at(self):
"""
Gets the updated_at of this UploadChunkInfo.
The time the entity was updated
:return: The updated_at of this UploadChunkInfo.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this UploadChunkInfo.
The time the entity was updated
:param updated_at: The updated_at of this UploadChunkInfo.
:type: datetime
"""
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UploadChunkInfo):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UploadChunkInfo(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, etag=None, hash=None, id=None, length=None, object=None, status=None, updated_at=None):
'''
UploadChunkInfo - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this UploadChunkInfo.
The time the entity was created
:return: The created_at of this UploadChunkInfo.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this UploadChunkInfo.
The time the entity was created
:param created_at: The created_at of this UploadChunkInfo.
:type: datetime
'''
pass
@property
def etag(self):
'''
Gets the etag of this UploadChunkInfo.
API resource entity version
:return: The etag of this UploadChunkInfo.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this UploadChunkInfo.
API resource entity version
:param etag: The etag of this UploadChunkInfo.
:type: str
'''
pass
@property
def hash(self):
'''
Gets the hash of this UploadChunkInfo.
The hash of the chunk. The default hash is MD5. If no Content-MD5 header is supplied as part of uploading the chunk then this will be empty.
:return: The hash of this UploadChunkInfo.
:rtype: str
'''
pass
@hash.setter
def hash(self):
'''
Sets the hash of this UploadChunkInfo.
The hash of the chunk. The default hash is MD5. If no Content-MD5 header is supplied as part of uploading the chunk then this will be empty.
:param hash: The hash of this UploadChunkInfo.
:type: str
'''
pass
@property
def id(self):
'''
Gets the id of this UploadChunkInfo.
The chunk number
:return: The id of this UploadChunkInfo.
:rtype: int
'''
pass
@id.setter
def id(self):
'''
Sets the id of this UploadChunkInfo.
The chunk number
:param id: The id of this UploadChunkInfo.
:type: int
'''
pass
@property
def length(self):
'''
Gets the length of this UploadChunkInfo.
The length of the chunk
:return: The length of this UploadChunkInfo.
:rtype: int
'''
pass
@length.setter
def length(self):
'''
Sets the length of this UploadChunkInfo.
The length of the chunk
:param length: The length of this UploadChunkInfo.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this UploadChunkInfo.
Entity name: always 'upload-info'
:return: The object of this UploadChunkInfo.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UploadChunkInfo.
Entity name: always 'upload-info'
:param object: The object of this UploadChunkInfo.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this UploadChunkInfo.
The upload status of this chunk
:return: The status of this UploadChunkInfo.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this UploadChunkInfo.
The upload status of this chunk
:param status: The status of this UploadChunkInfo.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this UploadChunkInfo.
The time the entity was updated
:return: The updated_at of this UploadChunkInfo.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this UploadChunkInfo.
The time the entity was updated
:param updated_at: The updated_at of this UploadChunkInfo.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 39 | 23 | 10 | 1 | 3 | 5 | 1 | 1.15 | 1 | 3 | 0 | 0 | 22 | 9 | 22 | 22 | 287 | 53 | 109 | 53 | 70 | 125 | 65 | 37 | 42 | 5 | 1 | 2 | 27 |
2,547 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/update_campaign_put_request.py
|
mbed_cloud._backends.update_service.models.update_campaign_put_request.UpdateCampaignPutRequest
|
class UpdateCampaignPutRequest(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'description': 'str',
'device_filter': 'str',
'name': 'str',
'object': 'str',
'root_manifest_id': 'str',
'state': 'str',
'when': 'datetime'
}
attribute_map = {
'description': 'description',
'device_filter': 'device_filter',
'name': 'name',
'object': 'object',
'root_manifest_id': 'root_manifest_id',
'state': 'state',
'when': 'when'
}
def __init__(self, description=None, device_filter=None, name=None, object=None, root_manifest_id=None, state=None, when=None):
"""
UpdateCampaignPutRequest - a model defined in Swagger
"""
self._description = description
self._device_filter = device_filter
self._name = name
self._object = object
self._root_manifest_id = root_manifest_id
self._state = state
self._when = when
self.discriminator = None
@property
def description(self):
"""
Gets the description of this UpdateCampaignPutRequest.
An optional description of the campaign
:return: The description of this UpdateCampaignPutRequest.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this UpdateCampaignPutRequest.
An optional description of the campaign
:param description: The description of this UpdateCampaignPutRequest.
:type: str
"""
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def device_filter(self):
"""
Gets the device_filter of this UpdateCampaignPutRequest.
The filter for the devices the campaign is targeting at
:return: The device_filter of this UpdateCampaignPutRequest.
:rtype: str
"""
return self._device_filter
@device_filter.setter
def device_filter(self, device_filter):
"""
Sets the device_filter of this UpdateCampaignPutRequest.
The filter for the devices the campaign is targeting at
:param device_filter: The device_filter of this UpdateCampaignPutRequest.
:type: str
"""
self._device_filter = device_filter
@property
def name(self):
"""
Gets the name of this UpdateCampaignPutRequest.
The campaign's name
:return: The name of this UpdateCampaignPutRequest.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this UpdateCampaignPutRequest.
The campaign's name
:param name: The name of this UpdateCampaignPutRequest.
:type: str
"""
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
@property
def object(self):
"""
Gets the object of this UpdateCampaignPutRequest.
The API resource entity
:return: The object of this UpdateCampaignPutRequest.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UpdateCampaignPutRequest.
The API resource entity
:param object: The object of this UpdateCampaignPutRequest.
:type: str
"""
self._object = object
@property
def root_manifest_id(self):
"""
Gets the root_manifest_id of this UpdateCampaignPutRequest.
:return: The root_manifest_id of this UpdateCampaignPutRequest.
:rtype: str
"""
return self._root_manifest_id
@root_manifest_id.setter
def root_manifest_id(self, root_manifest_id):
"""
Sets the root_manifest_id of this UpdateCampaignPutRequest.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignPutRequest.
:type: str
"""
if root_manifest_id is not None and len(root_manifest_id) > 32:
raise ValueError("Invalid value for `root_manifest_id`, length must be less than or equal to `32`")
self._root_manifest_id = root_manifest_id
@property
def state(self):
"""
Gets the state of this UpdateCampaignPutRequest.
The state of the campaign
:return: The state of this UpdateCampaignPutRequest.
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""
Sets the state of this UpdateCampaignPutRequest.
The state of the campaign
:param state: The state of this UpdateCampaignPutRequest.
:type: str
"""
allowed_values = ["draft", "scheduled", "allocatingquota", "allocatedquota", "quotaallocationfailed", "checkingmanifest", "checkedmanifest", "devicefetch", "devicecopy", "devicecheck", "publishing", "deploying", "deployed", "manifestremoved", "expired", "stopping", "autostopped", "userstopped", "conflict"]
if state not in allowed_values:
raise ValueError(
"Invalid value for `state` ({0}), must be one of {1}"
.format(state, allowed_values)
)
self._state = state
@property
def when(self):
"""
Gets the when of this UpdateCampaignPutRequest.
The scheduled start time for the update campaign. Not in use.
:return: The when of this UpdateCampaignPutRequest.
:rtype: datetime
"""
return self._when
@when.setter
def when(self, when):
"""
Sets the when of this UpdateCampaignPutRequest.
The scheduled start time for the update campaign. Not in use.
:param when: The when of this UpdateCampaignPutRequest.
:type: datetime
"""
self._when = when
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdateCampaignPutRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdateCampaignPutRequest(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, description=None, device_filter=None, name=None, object=None, root_manifest_id=None, state=None, when=None):
'''
UpdateCampaignPutRequest - a model defined in Swagger
'''
pass
@property
def description(self):
'''
Gets the description of this UpdateCampaignPutRequest.
An optional description of the campaign
:return: The description of this UpdateCampaignPutRequest.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this UpdateCampaignPutRequest.
An optional description of the campaign
:param description: The description of this UpdateCampaignPutRequest.
:type: str
'''
pass
@property
def device_filter(self):
'''
Gets the device_filter of this UpdateCampaignPutRequest.
The filter for the devices the campaign is targeting at
:return: The device_filter of this UpdateCampaignPutRequest.
:rtype: str
'''
pass
@device_filter.setter
def device_filter(self):
'''
Sets the device_filter of this UpdateCampaignPutRequest.
The filter for the devices the campaign is targeting at
:param device_filter: The device_filter of this UpdateCampaignPutRequest.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this UpdateCampaignPutRequest.
The campaign's name
:return: The name of this UpdateCampaignPutRequest.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this UpdateCampaignPutRequest.
The campaign's name
:param name: The name of this UpdateCampaignPutRequest.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this UpdateCampaignPutRequest.
The API resource entity
:return: The object of this UpdateCampaignPutRequest.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UpdateCampaignPutRequest.
The API resource entity
:param object: The object of this UpdateCampaignPutRequest.
:type: str
'''
pass
@property
def root_manifest_id(self):
'''
Gets the root_manifest_id of this UpdateCampaignPutRequest.
:return: The root_manifest_id of this UpdateCampaignPutRequest.
:rtype: str
'''
pass
@root_manifest_id.setter
def root_manifest_id(self):
'''
Sets the root_manifest_id of this UpdateCampaignPutRequest.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignPutRequest.
:type: str
'''
pass
@property
def state(self):
'''
Gets the state of this UpdateCampaignPutRequest.
The state of the campaign
:return: The state of this UpdateCampaignPutRequest.
:rtype: str
'''
pass
@state.setter
def state(self):
'''
Sets the state of this UpdateCampaignPutRequest.
The state of the campaign
:param state: The state of this UpdateCampaignPutRequest.
:type: str
'''
pass
@property
def when(self):
'''
Gets the when of this UpdateCampaignPutRequest.
The scheduled start time for the update campaign. Not in use.
:return: The when of this UpdateCampaignPutRequest.
:rtype: datetime
'''
pass
@when.setter
def when(self):
'''
Sets the when of this UpdateCampaignPutRequest.
The scheduled start time for the update campaign. Not in use.
:param when: The when of this UpdateCampaignPutRequest.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 10 | 1 | 4 | 5 | 1 | 0.99 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 271 | 48 | 112 | 49 | 77 | 111 | 69 | 35 | 48 | 5 | 1 | 2 | 29 |
2,548 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/update_campaign_post_request.py
|
mbed_cloud._backends.update_service.models.update_campaign_post_request.UpdateCampaignPostRequest
|
class UpdateCampaignPostRequest(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'description': 'str',
'device_filter': 'str',
'name': 'str',
'object': 'str',
'root_manifest_id': 'str',
'state': 'str',
'when': 'datetime'
}
attribute_map = {
'description': 'description',
'device_filter': 'device_filter',
'name': 'name',
'object': 'object',
'root_manifest_id': 'root_manifest_id',
'state': 'state',
'when': 'when'
}
def __init__(self, description=None, device_filter=None, name=None, object=None, root_manifest_id=None, state=None, when=None):
"""
UpdateCampaignPostRequest - a model defined in Swagger
"""
self._description = description
self._device_filter = device_filter
self._name = name
self._object = object
self._root_manifest_id = root_manifest_id
self._state = state
self._when = when
self.discriminator = None
@property
def description(self):
"""
Gets the description of this UpdateCampaignPostRequest.
An optional description of the campaign
:return: The description of this UpdateCampaignPostRequest.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this UpdateCampaignPostRequest.
An optional description of the campaign
:param description: The description of this UpdateCampaignPostRequest.
:type: str
"""
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def device_filter(self):
"""
Gets the device_filter of this UpdateCampaignPostRequest.
The filter for the devices the campaign is targeting at
:return: The device_filter of this UpdateCampaignPostRequest.
:rtype: str
"""
return self._device_filter
@device_filter.setter
def device_filter(self, device_filter):
"""
Sets the device_filter of this UpdateCampaignPostRequest.
The filter for the devices the campaign is targeting at
:param device_filter: The device_filter of this UpdateCampaignPostRequest.
:type: str
"""
if device_filter is None:
raise ValueError("Invalid value for `device_filter`, must not be `None`")
self._device_filter = device_filter
@property
def name(self):
"""
Gets the name of this UpdateCampaignPostRequest.
The name for this campaign
:return: The name of this UpdateCampaignPostRequest.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this UpdateCampaignPostRequest.
The name for this campaign
:param name: The name of this UpdateCampaignPostRequest.
:type: str
"""
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
@property
def object(self):
"""
Gets the object of this UpdateCampaignPostRequest.
The API resource entity
:return: The object of this UpdateCampaignPostRequest.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UpdateCampaignPostRequest.
The API resource entity
:param object: The object of this UpdateCampaignPostRequest.
:type: str
"""
self._object = object
@property
def root_manifest_id(self):
"""
Gets the root_manifest_id of this UpdateCampaignPostRequest.
:return: The root_manifest_id of this UpdateCampaignPostRequest.
:rtype: str
"""
return self._root_manifest_id
@root_manifest_id.setter
def root_manifest_id(self, root_manifest_id):
"""
Sets the root_manifest_id of this UpdateCampaignPostRequest.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignPostRequest.
:type: str
"""
if root_manifest_id is not None and len(root_manifest_id) > 32:
raise ValueError("Invalid value for `root_manifest_id`, length must be less than or equal to `32`")
self._root_manifest_id = root_manifest_id
@property
def state(self):
"""
Gets the state of this UpdateCampaignPostRequest.
The state of the campaign
:return: The state of this UpdateCampaignPostRequest.
:rtype: str
"""
return self._state
@state.setter
def state(self, state):
"""
Sets the state of this UpdateCampaignPostRequest.
The state of the campaign
:param state: The state of this UpdateCampaignPostRequest.
:type: str
"""
allowed_values = ["draft", "scheduled", "allocatingquota", "allocatedquota", "quotaallocationfailed", "checkingmanifest", "checkedmanifest", "devicefetch", "devicecopy", "devicecheck", "publishing", "deploying", "deployed", "manifestremoved", "expired", "stopping", "autostopped", "userstopped", "conflict"]
if state not in allowed_values:
raise ValueError(
"Invalid value for `state` ({0}), must be one of {1}"
.format(state, allowed_values)
)
self._state = state
@property
def when(self):
"""
Gets the when of this UpdateCampaignPostRequest.
The scheduled start time for the update campaign. Not in use.
:return: The when of this UpdateCampaignPostRequest.
:rtype: datetime
"""
return self._when
@when.setter
def when(self, when):
"""
Sets the when of this UpdateCampaignPostRequest.
The scheduled start time for the update campaign. Not in use.
:param when: The when of this UpdateCampaignPostRequest.
:type: datetime
"""
self._when = when
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdateCampaignPostRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdateCampaignPostRequest(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, description=None, device_filter=None, name=None, object=None, root_manifest_id=None, state=None, when=None):
'''
UpdateCampaignPostRequest - a model defined in Swagger
'''
pass
@property
def description(self):
'''
Gets the description of this UpdateCampaignPostRequest.
An optional description of the campaign
:return: The description of this UpdateCampaignPostRequest.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this UpdateCampaignPostRequest.
An optional description of the campaign
:param description: The description of this UpdateCampaignPostRequest.
:type: str
'''
pass
@property
def device_filter(self):
'''
Gets the device_filter of this UpdateCampaignPostRequest.
The filter for the devices the campaign is targeting at
:return: The device_filter of this UpdateCampaignPostRequest.
:rtype: str
'''
pass
@device_filter.setter
def device_filter(self):
'''
Sets the device_filter of this UpdateCampaignPostRequest.
The filter for the devices the campaign is targeting at
:param device_filter: The device_filter of this UpdateCampaignPostRequest.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this UpdateCampaignPostRequest.
The name for this campaign
:return: The name of this UpdateCampaignPostRequest.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this UpdateCampaignPostRequest.
The name for this campaign
:param name: The name of this UpdateCampaignPostRequest.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this UpdateCampaignPostRequest.
The API resource entity
:return: The object of this UpdateCampaignPostRequest.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UpdateCampaignPostRequest.
The API resource entity
:param object: The object of this UpdateCampaignPostRequest.
:type: str
'''
pass
@property
def root_manifest_id(self):
'''
Gets the root_manifest_id of this UpdateCampaignPostRequest.
:return: The root_manifest_id of this UpdateCampaignPostRequest.
:rtype: str
'''
pass
@root_manifest_id.setter
def root_manifest_id(self):
'''
Sets the root_manifest_id of this UpdateCampaignPostRequest.
:param root_manifest_id: The root_manifest_id of this UpdateCampaignPostRequest.
:type: str
'''
pass
@property
def state(self):
'''
Gets the state of this UpdateCampaignPostRequest.
The state of the campaign
:return: The state of this UpdateCampaignPostRequest.
:rtype: str
'''
pass
@state.setter
def state(self):
'''
Sets the state of this UpdateCampaignPostRequest.
The state of the campaign
:param state: The state of this UpdateCampaignPostRequest.
:type: str
'''
pass
@property
def when(self):
'''
Gets the when of this UpdateCampaignPostRequest.
The scheduled start time for the update campaign. Not in use.
:return: The when of this UpdateCampaignPostRequest.
:rtype: datetime
'''
pass
@when.setter
def when(self):
'''
Sets the when of this UpdateCampaignPostRequest.
The scheduled start time for the update campaign. Not in use.
:param when: The when of this UpdateCampaignPostRequest.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 10 | 1 | 4 | 5 | 2 | 0.97 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 273 | 48 | 114 | 49 | 79 | 111 | 71 | 35 | 50 | 5 | 1 | 2 | 30 |
2,549 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/update_campaign_page.py
|
mbed_cloud._backends.update_service.models.update_campaign_page.UpdateCampaignPage
|
class UpdateCampaignPage(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[UpdateCampaign]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
UpdateCampaignPage - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this UpdateCampaignPage.
:return: The after of this UpdateCampaignPage.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this UpdateCampaignPage.
:param after: The after of this UpdateCampaignPage.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this UpdateCampaignPage.
:return: The data of this UpdateCampaignPage.
:rtype: list[UpdateCampaign]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this UpdateCampaignPage.
:param data: The data of this UpdateCampaignPage.
:type: list[UpdateCampaign]
"""
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this UpdateCampaignPage.
:return: The has_more of this UpdateCampaignPage.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this UpdateCampaignPage.
:param has_more: The has_more of this UpdateCampaignPage.
:type: bool
"""
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this UpdateCampaignPage.
:return: The limit of this UpdateCampaignPage.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this UpdateCampaignPage.
:param limit: The limit of this UpdateCampaignPage.
:type: int
"""
self._limit = limit
@property
def object(self):
"""
Gets the object of this UpdateCampaignPage.
:return: The object of this UpdateCampaignPage.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UpdateCampaignPage.
:param object: The object of this UpdateCampaignPage.
:type: str
"""
self._object = object
@property
def order(self):
"""
Gets the order of this UpdateCampaignPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this UpdateCampaignPage.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this UpdateCampaignPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this UpdateCampaignPage.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this UpdateCampaignPage.
:return: The total_count of this UpdateCampaignPage.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this UpdateCampaignPage.
:param total_count: The total_count of this UpdateCampaignPage.
:type: int
"""
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdateCampaignPage):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdateCampaignPage(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
UpdateCampaignPage - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this UpdateCampaignPage.
:return: The after of this UpdateCampaignPage.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this UpdateCampaignPage.
:param after: The after of this UpdateCampaignPage.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this UpdateCampaignPage.
:return: The data of this UpdateCampaignPage.
:rtype: list[UpdateCampaign]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this UpdateCampaignPage.
:param data: The data of this UpdateCampaignPage.
:type: list[UpdateCampaign]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this UpdateCampaignPage.
:return: The has_more of this UpdateCampaignPage.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this UpdateCampaignPage.
:param has_more: The has_more of this UpdateCampaignPage.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this UpdateCampaignPage.
:return: The limit of this UpdateCampaignPage.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this UpdateCampaignPage.
:param limit: The limit of this UpdateCampaignPage.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this UpdateCampaignPage.
:return: The object of this UpdateCampaignPage.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UpdateCampaignPage.
:param object: The object of this UpdateCampaignPage.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this UpdateCampaignPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this UpdateCampaignPage.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this UpdateCampaignPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this UpdateCampaignPage.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this UpdateCampaignPage.
:return: The total_count of this UpdateCampaignPage.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this UpdateCampaignPage.
:param total_count: The total_count of this UpdateCampaignPage.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 9 | 1 | 4 | 5 | 1 | 0.95 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 255 | 48 | 106 | 49 | 71 | 101 | 63 | 35 | 42 | 5 | 1 | 2 | 26 |
2,550 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/account_management/account_management.py
|
mbed_cloud.account_management.account_management.Group
|
class Group(BaseObject):
"""Describes group object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Listing existing groups
for idx, g in enumerate(api.list_groups())
print(g.name)
"""
@staticmethod
def _get_attributes_map():
return {
"id": "id",
"account_id": "account_id",
"name": "name",
"user_count": "user_count",
"api_key_count": "apikey_count",
"created_at": "created_at",
"creation_time": "creation_time",
"last_update_time": "last_update_time",
}
@property
def id(self):
"""The UUID of the group. (readonly)
:rtype: str
"""
return self._id
@property
def account_id(self):
"""The UUID of the account this group belongs to. (readonly)
:rtype: str
"""
return self._account_id
@property
def name(self):
"""The name of the group. (readonly)
:rtype: str
"""
return self._name
@property
def user_count(self):
"""The number of users in this group. (readonly)
:rtype: int
"""
return self._user_count
@property
def api_key_count(self):
"""The number of API keys in this group. (readonly)
:rtype: int
"""
return self._api_key_count
@property
def created_at(self):
"""Creation UTC time RFC3339. (readonly)
:rtype: datetime
"""
return self._created_at
@property
def creation_time(self):
"""A timestamp of the group creation in the storage, in milliseconds. (readonly)
:rtype: int
"""
return self._creation_time
@property
def last_update_time(self):
"""The last update time
:rtype: datetime
"""
return self._last_update_time
|
class Group(BaseObject):
'''Describes group object.
Example usage:
.. code-block:: python
api = AccountManagementAPI()
# Listing existing groups
for idx, g in enumerate(api.list_groups())
print(g.name)
'''
@staticmethod
def _get_attributes_map():
pass
@property
def id(self):
'''The UUID of the group. (readonly)
:rtype: str
'''
pass
@property
def account_id(self):
'''The UUID of the account this group belongs to. (readonly)
:rtype: str
'''
pass
@property
def name(self):
'''The name of the group. (readonly)
:rtype: str
'''
pass
@property
def user_count(self):
'''The number of users in this group. (readonly)
:rtype: int
'''
pass
@property
def api_key_count(self):
'''The number of API keys in this group. (readonly)
:rtype: int
'''
pass
@property
def created_at(self):
'''Creation UTC time RFC3339. (readonly)
:rtype: datetime
'''
pass
@property
def creation_time(self):
'''A timestamp of the group creation in the storage, in milliseconds. (readonly)
:rtype: int
'''
pass
@property
def last_update_time(self):
'''The last update time
:rtype: datetime
'''
pass
| 19 | 9 | 7 | 1 | 3 | 3 | 1 | 0.86 | 1 | 0 | 0 | 0 | 8 | 0 | 9 | 17 | 90 | 21 | 37 | 19 | 18 | 32 | 19 | 10 | 9 | 1 | 2 | 0 | 9 |
2,551 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/connect/resource.py
|
mbed_cloud.connect.resource.Resource
|
class Resource(object):
"""Describes resource type from device.
Example usage:
.. code-block:: python
>>> resources = api.list_resources(device_id)
>>> for r in resources:
print(r.uri, r.name, r.observable)
/3/0/1,None,True
/5/0/2,Update,False
...
"""
def __init__(self, resource_obj):
"""Override __init__ and allow passing in backend object."""
self._observable = resource_obj.obs
self._path = resource_obj.uri
self._type = resource_obj.rt
self._content_type = resource_obj.type
@property
def observable(self):
"""Get the observability of this Resource.
Whether the resource is observable or not (true/false)
:return: The observability of this ResourcesData.
:rtype: bool
"""
return self._observable
@property
def path(self):
"""Get the URI of this Resource.
:return: The URI of this Resource.
:rtype: str
"""
return self._path
@property
def type(self):
"""Get the type of this Resource, if set.
:return: The type of the Resource.
:rtype: str
"""
return self._type
@property
def content_type(self):
"""The content type of this Resource, if set.
:return: The content type of the Resource.
:rtype: str
"""
return self._content_type
def to_dict(self):
"""Return dictionary of object."""
return {
'observable': self.observable,
'path': self.path,
'type': self.type,
'content_type': self.content_type
}
def __repr__(self):
"""For print and pprint."""
return str(self.to_dict())
|
class Resource(object):
'''Describes resource type from device.
Example usage:
.. code-block:: python
>>> resources = api.list_resources(device_id)
>>> for r in resources:
print(r.uri, r.name, r.observable)
/3/0/1,None,True
/5/0/2,Update,False
...
'''
def __init__(self, resource_obj):
'''Override __init__ and allow passing in backend object.'''
pass
@property
def observable(self):
'''Get the observability of this Resource.
Whether the resource is observable or not (true/false)
:return: The observability of this ResourcesData.
:rtype: bool
'''
pass
@property
def path(self):
'''Get the URI of this Resource.
:return: The URI of this Resource.
:rtype: str
'''
pass
@property
def type(self):
'''Get the type of this Resource, if set.
:return: The type of the Resource.
:rtype: str
'''
pass
@property
def content_type(self):
'''The content type of this Resource, if set.
:return: The content type of the Resource.
:rtype: str
'''
pass
def to_dict(self):
'''Return dictionary of object.'''
pass
def __repr__(self):
'''For print and pprint.'''
pass
| 12 | 8 | 7 | 1 | 3 | 3 | 1 | 1.11 | 1 | 1 | 0 | 0 | 7 | 4 | 7 | 7 | 72 | 15 | 27 | 16 | 15 | 30 | 18 | 12 | 10 | 1 | 1 | 0 | 7 |
2,552 |
ARMmbed/mbed-cloud-sdk-python
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/ARMmbed_mbed-cloud-sdk-python/tests/unit/test_tlv_b64_examples.py
|
tests.unit.test_tlv_b64_examples.B64.TestCase
|
class TestCase(BaseCase):
b64 = None # an ascii string containing b64 encoded data
result = None # the python-native data we expect to decode
decoded = None # we'll store the result here in the test
def test_run(self):
self.decoded = maybe_decode_payload(self.b64)
self.assertion()
def assertion(self):
self.assertEqual(self.decoded, self.result)
|
class TestCase(BaseCase):
def test_run(self):
pass
def assertion(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0.33 | 1 | 0 | 0 | 5 | 2 | 0 | 2 | 74 | 11 | 2 | 9 | 6 | 6 | 3 | 9 | 6 | 6 | 1 | 3 | 0 | 2 |
2,553 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/campaign_device_metadata_page.py
|
mbed_cloud._backends.update_service.models.campaign_device_metadata_page.CampaignDeviceMetadataPage
|
class CampaignDeviceMetadataPage(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[CampaignDeviceMetadata]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
CampaignDeviceMetadataPage - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this CampaignDeviceMetadataPage.
The entity ID to fetch after the given one
:return: The after of this CampaignDeviceMetadataPage.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this CampaignDeviceMetadataPage.
The entity ID to fetch after the given one
:param after: The after of this CampaignDeviceMetadataPage.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this CampaignDeviceMetadataPage.
A list of entities
:return: The data of this CampaignDeviceMetadataPage.
:rtype: list[CampaignDeviceMetadata]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this CampaignDeviceMetadataPage.
A list of entities
:param data: The data of this CampaignDeviceMetadataPage.
:type: list[CampaignDeviceMetadata]
"""
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this CampaignDeviceMetadataPage.
A flag indicating whether there are more results
:return: The has_more of this CampaignDeviceMetadataPage.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this CampaignDeviceMetadataPage.
A flag indicating whether there are more results
:param has_more: The has_more of this CampaignDeviceMetadataPage.
:type: bool
"""
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this CampaignDeviceMetadataPage.
The number of results to return, (range: 2-1000), or equals to total_count
:return: The limit of this CampaignDeviceMetadataPage.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this CampaignDeviceMetadataPage.
The number of results to return, (range: 2-1000), or equals to total_count
:param limit: The limit of this CampaignDeviceMetadataPage.
:type: int
"""
self._limit = limit
@property
def object(self):
"""
Gets the object of this CampaignDeviceMetadataPage.
The entity name: always 'list'
:return: The object of this CampaignDeviceMetadataPage.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this CampaignDeviceMetadataPage.
The entity name: always 'list'
:param object: The object of this CampaignDeviceMetadataPage.
:type: str
"""
self._object = object
@property
def order(self):
"""
Gets the order of this CampaignDeviceMetadataPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this CampaignDeviceMetadataPage.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this CampaignDeviceMetadataPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this CampaignDeviceMetadataPage.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this CampaignDeviceMetadataPage.
The total number or records, if requested. It may be returned also for small lists.
:return: The total_count of this CampaignDeviceMetadataPage.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this CampaignDeviceMetadataPage.
The total number or records, if requested. It may be returned also for small lists.
:param total_count: The total_count of this CampaignDeviceMetadataPage.
:type: int
"""
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, CampaignDeviceMetadataPage):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class CampaignDeviceMetadataPage(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
CampaignDeviceMetadataPage - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this CampaignDeviceMetadataPage.
The entity ID to fetch after the given one
:return: The after of this CampaignDeviceMetadataPage.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this CampaignDeviceMetadataPage.
The entity ID to fetch after the given one
:param after: The after of this CampaignDeviceMetadataPage.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this CampaignDeviceMetadataPage.
A list of entities
:return: The data of this CampaignDeviceMetadataPage.
:rtype: list[CampaignDeviceMetadata]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this CampaignDeviceMetadataPage.
A list of entities
:param data: The data of this CampaignDeviceMetadataPage.
:type: list[CampaignDeviceMetadata]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this CampaignDeviceMetadataPage.
A flag indicating whether there are more results
:return: The has_more of this CampaignDeviceMetadataPage.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this CampaignDeviceMetadataPage.
A flag indicating whether there are more results
:param has_more: The has_more of this CampaignDeviceMetadataPage.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this CampaignDeviceMetadataPage.
The number of results to return, (range: 2-1000), or equals to total_count
:return: The limit of this CampaignDeviceMetadataPage.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this CampaignDeviceMetadataPage.
The number of results to return, (range: 2-1000), or equals to total_count
:param limit: The limit of this CampaignDeviceMetadataPage.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this CampaignDeviceMetadataPage.
The entity name: always 'list'
:return: The object of this CampaignDeviceMetadataPage.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this CampaignDeviceMetadataPage.
The entity name: always 'list'
:param object: The object of this CampaignDeviceMetadataPage.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this CampaignDeviceMetadataPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:return: The order of this CampaignDeviceMetadataPage.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this CampaignDeviceMetadataPage.
The order of the records to return. Acceptable values: ASC, DESC. Default: ASC
:param order: The order of this CampaignDeviceMetadataPage.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this CampaignDeviceMetadataPage.
The total number or records, if requested. It may be returned also for small lists.
:return: The total_count of this CampaignDeviceMetadataPage.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this CampaignDeviceMetadataPage.
The total number or records, if requested. It may be returned also for small lists.
:param total_count: The total_count of this CampaignDeviceMetadataPage.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 10 | 1 | 4 | 5 | 1 | 1.07 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 267 | 48 | 106 | 49 | 71 | 113 | 63 | 35 | 42 | 5 | 1 | 2 | 26 |
2,554 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/apis/endpoints_api.py
|
mbed_cloud._backends.mds.apis.endpoints_api.EndpointsApi
|
class EndpointsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_connected_endpoints(self, **kwargs): # noqa: E501
"""(DEPRECATED) List registered endpoints. The number of returned endpoints is currently limited to 200. # noqa: E501
Endpoints are physical devices having valid registration to Device Management. All devices regardless of registration status can be requested from Device Directory API ['/v3/devices/`](/docs/current/service-api-references/device-directory.html). **Note:** This endpoint is deprecated and will be removed 1Q/18. You should use the Device Directory API [`/v3/devices/`](/docs/current/service-api-references/device-directory.html). To list only the registered devices, use filter `/v3/devices/?filter=state%3Dregistered`. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_connected_endpoints(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str type: Filter endpoints by endpoint-type.
:return: list[Endpoint]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_connected_endpoints_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_connected_endpoints_with_http_info(**kwargs) # noqa: E501
return data
def get_connected_endpoints_with_http_info(self, **kwargs): # noqa: E501
"""(DEPRECATED) List registered endpoints. The number of returned endpoints is currently limited to 200. # noqa: E501
Endpoints are physical devices having valid registration to Device Management. All devices regardless of registration status can be requested from Device Directory API ['/v3/devices/`](/docs/current/service-api-references/device-directory.html). **Note:** This endpoint is deprecated and will be removed 1Q/18. You should use the Device Directory API [`/v3/devices/`](/docs/current/service-api-references/device-directory.html). To list only the registered devices, use filter `/v3/devices/?filter=state%3Dregistered`. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_connected_endpoints_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str type: Filter endpoints by endpoint-type.
:return: list[Endpoint]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['type'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_connected_endpoints" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'type' in params:
query_params.append(('type', params['type'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/endpoints', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[Endpoint]', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_endpoint_resources(self, device_id, **kwargs): # noqa: E501
"""List the resources on an endpoint # noqa: E501
The list of resources is cached by Device Management Connect, so this call does not create a message to the device. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id} -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_resources(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique device ID for an endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:return: list[Resource]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_endpoint_resources_with_http_info(device_id, **kwargs) # noqa: E501
else:
(data) = self.get_endpoint_resources_with_http_info(device_id, **kwargs) # noqa: E501
return data
def get_endpoint_resources_with_http_info(self, device_id, **kwargs): # noqa: E501
"""List the resources on an endpoint # noqa: E501
The list of resources is cached by Device Management Connect, so this call does not create a message to the device. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id} -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_resources_with_http_info(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique device ID for an endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:return: list[Resource]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_endpoint_resources" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `get_endpoint_resources`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/endpoints/{device-id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[Resource]', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class EndpointsApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def get_connected_endpoints(self, **kwargs):
'''(DEPRECATED) List registered endpoints. The number of returned endpoints is currently limited to 200. # noqa: E501
Endpoints are physical devices having valid registration to Device Management. All devices regardless of registration status can be requested from Device Directory API ['/v3/devices/`](/docs/current/service-api-references/device-directory.html). **Note:** This endpoint is deprecated and will be removed 1Q/18. You should use the Device Directory API [`/v3/devices/`](/docs/current/service-api-references/device-directory.html). To list only the registered devices, use filter `/v3/devices/?filter=state%3Dregistered`. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_connected_endpoints(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str type: Filter endpoints by endpoint-type.
:return: list[Endpoint]
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_connected_endpoints_with_http_info(self, **kwargs):
'''(DEPRECATED) List registered endpoints. The number of returned endpoints is currently limited to 200. # noqa: E501
Endpoints are physical devices having valid registration to Device Management. All devices regardless of registration status can be requested from Device Directory API ['/v3/devices/`](/docs/current/service-api-references/device-directory.html). **Note:** This endpoint is deprecated and will be removed 1Q/18. You should use the Device Directory API [`/v3/devices/`](/docs/current/service-api-references/device-directory.html). To list only the registered devices, use filter `/v3/devices/?filter=state%3Dregistered`. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_connected_endpoints_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str type: Filter endpoints by endpoint-type.
:return: list[Endpoint]
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_endpoint_resources(self, device_id, **kwargs):
'''List the resources on an endpoint # noqa: E501
The list of resources is cached by Device Management Connect, so this call does not create a message to the device. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id} -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_resources(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique device ID for an endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:return: list[Resource]
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_endpoint_resources_with_http_info(self, device_id, **kwargs):
'''List the resources on an endpoint # noqa: E501
The list of resources is cached by Device Management Connect, so this call does not create a message to the device. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id} -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_resources_with_http_info(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique device ID for an endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:return: list[Resource]
If the method is called asynchronously,
returns the request thread.
'''
pass
| 6 | 5 | 37 | 6 | 21 | 14 | 3 | 0.72 | 1 | 3 | 1 | 0 | 5 | 1 | 5 | 5 | 197 | 34 | 106 | 31 | 100 | 76 | 67 | 31 | 61 | 5 | 1 | 2 | 15 |
2,555 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/apis/device_requests_api.py
|
mbed_cloud._backends.mds.apis.device_requests_api.DeviceRequestsApi
|
class DeviceRequestsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def create_async_request(self, device_id, async_id, body, **kwargs): # noqa: E501
"""Send an async request to device # noqa: E501
This API provides an interface to asynchronously call methods on a device. The `async-id` is provided by the client, enabling the client to track the end-to-end flow with an identifier that is relevant to the end application. For example, a web application's session ID along with the device ID and the resource path could be used as the `async-id`. This also avoids any race conditions with [the notification channel](/docs/current/integrate-web-app/event-notification.html). All responses are sent through the currently configured notification channel as an **AsyncIDResponse**. For `GET` methods, values may be fetched from an internal cache, instead of contacting the device. See also /v2/endpoints/{device-id}/{resourcePath}. ``` Example URI: POST /v2/device-requests/015f2fa34d310000000000010030036c?async-id=123e4567-e89b-12d3-a456-426655440000 Example payloads: { \"method\": \"GET\", \"uri\": \"/5/0/1\" } { \"method\": \"PUT\", \"uri\": \"/5/0/1%20?k1=v1&k2=v2%22\", \"accept\": \"text/plain\", \"content-type\": \"text/plain\", \"payload-b64\": \"dmFsdWUxCg==\" } Immediate response: 202 Accepted Example AsyncIDResponse, delivered via the notification channel: { \"async-responses\": [ { \"id\": \"123e4567-e89b-12d3-a456-426655440000\", \"status\": 200, \"payload\": \"dmFsdWUxCg==\", \"ct\": \"text/plain\", \"max-age\": 600 } ] } ``` # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.create_async_request(device_id, async_id, body, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: The device ID generated by Device Management. (required)
:param str async_id: The client-generated ID for matching the correct response delivered via a notification. (required)
:param DeviceRequest body: Device request to send. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.create_async_request_with_http_info(device_id, async_id, body, **kwargs) # noqa: E501
else:
(data) = self.create_async_request_with_http_info(device_id, async_id, body, **kwargs) # noqa: E501
return data
def create_async_request_with_http_info(self, device_id, async_id, body, **kwargs): # noqa: E501
"""Send an async request to device # noqa: E501
This API provides an interface to asynchronously call methods on a device. The `async-id` is provided by the client, enabling the client to track the end-to-end flow with an identifier that is relevant to the end application. For example, a web application's session ID along with the device ID and the resource path could be used as the `async-id`. This also avoids any race conditions with [the notification channel](/docs/current/integrate-web-app/event-notification.html). All responses are sent through the currently configured notification channel as an **AsyncIDResponse**. For `GET` methods, values may be fetched from an internal cache, instead of contacting the device. See also /v2/endpoints/{device-id}/{resourcePath}. ``` Example URI: POST /v2/device-requests/015f2fa34d310000000000010030036c?async-id=123e4567-e89b-12d3-a456-426655440000 Example payloads: { \"method\": \"GET\", \"uri\": \"/5/0/1\" } { \"method\": \"PUT\", \"uri\": \"/5/0/1%20?k1=v1&k2=v2%22\", \"accept\": \"text/plain\", \"content-type\": \"text/plain\", \"payload-b64\": \"dmFsdWUxCg==\" } Immediate response: 202 Accepted Example AsyncIDResponse, delivered via the notification channel: { \"async-responses\": [ { \"id\": \"123e4567-e89b-12d3-a456-426655440000\", \"status\": 200, \"payload\": \"dmFsdWUxCg==\", \"ct\": \"text/plain\", \"max-age\": 600 } ] } ``` # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.create_async_request_with_http_info(device_id, async_id, body, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: The device ID generated by Device Management. (required)
:param str async_id: The client-generated ID for matching the correct response delivered via a notification. (required)
:param DeviceRequest body: Device request to send. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', 'async_id', 'body'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method create_async_request" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `create_async_request`") # noqa: E501
# verify the required parameter 'async_id' is set
if ('async_id' not in params or
params['async_id'] is None):
raise ValueError("Missing the required parameter `async_id` when calling `create_async_request`") # noqa: E501
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `create_async_request`") # noqa: E501
if 'async_id' in params and not re.search('^[\\w\\-]{1,40}$', params['async_id']): # noqa: E501
raise ValueError("Invalid value for parameter `async_id` when calling `create_async_request`, must conform to the pattern `/^[\\w\\-]{1,40}$/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
query_params = []
if 'async_id' in params:
query_params.append(('async-id', params['async_id'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/device-requests/{device-id}', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class DeviceRequestsApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def create_async_request(self, device_id, async_id, body, **kwargs):
'''Send an async request to device # noqa: E501
This API provides an interface to asynchronously call methods on a device. The `async-id` is provided by the client, enabling the client to track the end-to-end flow with an identifier that is relevant to the end application. For example, a web application's session ID along with the device ID and the resource path could be used as the `async-id`. This also avoids any race conditions with [the notification channel](/docs/current/integrate-web-app/event-notification.html). All responses are sent through the currently configured notification channel as an **AsyncIDResponse**. For `GET` methods, values may be fetched from an internal cache, instead of contacting the device. See also /v2/endpoints/{device-id}/{resourcePath}. ``` Example URI: POST /v2/device-requests/015f2fa34d310000000000010030036c?async-id=123e4567-e89b-12d3-a456-426655440000 Example payloads: { "method": "GET", "uri": "/5/0/1" } { "method": "PUT", "uri": "/5/0/1%20?k1=v1&k2=v2%22", "accept": "text/plain", "content-type": "text/plain", "payload-b64": "dmFsdWUxCg==" } Immediate response: 202 Accepted Example AsyncIDResponse, delivered via the notification channel: { "async-responses": [ { "id": "123e4567-e89b-12d3-a456-426655440000", "status": 200, "payload": "dmFsdWUxCg==", "ct": "text/plain", "max-age": 600 } ] } ``` # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.create_async_request(device_id, async_id, body, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: The device ID generated by Device Management. (required)
:param str async_id: The client-generated ID for matching the correct response delivered via a notification. (required)
:param DeviceRequest body: Device request to send. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def create_async_request_with_http_info(self, device_id, async_id, body, **kwargs):
'''Send an async request to device # noqa: E501
This API provides an interface to asynchronously call methods on a device. The `async-id` is provided by the client, enabling the client to track the end-to-end flow with an identifier that is relevant to the end application. For example, a web application's session ID along with the device ID and the resource path could be used as the `async-id`. This also avoids any race conditions with [the notification channel](/docs/current/integrate-web-app/event-notification.html). All responses are sent through the currently configured notification channel as an **AsyncIDResponse**. For `GET` methods, values may be fetched from an internal cache, instead of contacting the device. See also /v2/endpoints/{device-id}/{resourcePath}. ``` Example URI: POST /v2/device-requests/015f2fa34d310000000000010030036c?async-id=123e4567-e89b-12d3-a456-426655440000 Example payloads: { "method": "GET", "uri": "/5/0/1" } { "method": "PUT", "uri": "/5/0/1%20?k1=v1&k2=v2%22", "accept": "text/plain", "content-type": "text/plain", "payload-b64": "dmFsdWUxCg==" } Immediate response: 202 Accepted Example AsyncIDResponse, delivered via the notification channel: { "async-responses": [ { "id": "123e4567-e89b-12d3-a456-426655440000", "status": 200, "payload": "dmFsdWUxCg==", "ct": "text/plain", "max-age": 600 } ] } ``` # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.create_async_request_with_http_info(device_id, async_id, body, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: The device ID generated by Device Management. (required)
:param str async_id: The client-generated ID for matching the correct response delivered via a notification. (required)
:param DeviceRequest body: Device request to send. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
| 4 | 3 | 40 | 5 | 23 | 17 | 5 | 0.77 | 1 | 3 | 1 | 0 | 3 | 1 | 3 | 3 | 128 | 19 | 71 | 17 | 67 | 55 | 48 | 17 | 44 | 10 | 1 | 2 | 14 |
2,556 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/user_update_req.py
|
mbed_cloud._backends.iam.models.user_update_req.UserUpdateReq
|
class UserUpdateReq(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'address': 'str',
'email': 'str',
'full_name': 'str',
'groups': 'list[str]',
'is_gtc_accepted': 'bool',
'is_marketing_accepted': 'bool',
'is_totp_enabled': 'bool',
'phone_number': 'str',
'status': 'str',
'username': 'str'
}
attribute_map = {
'address': 'address',
'email': 'email',
'full_name': 'full_name',
'groups': 'groups',
'is_gtc_accepted': 'is_gtc_accepted',
'is_marketing_accepted': 'is_marketing_accepted',
'is_totp_enabled': 'is_totp_enabled',
'phone_number': 'phone_number',
'status': 'status',
'username': 'username'
}
def __init__(self, address=None, email=None, full_name=None, groups=None, is_gtc_accepted=None, is_marketing_accepted=None, is_totp_enabled=None, phone_number=None, status=None, username=None):
"""
UserUpdateReq - a model defined in Swagger
"""
self._address = address
self._email = email
self._full_name = full_name
self._groups = groups
self._is_gtc_accepted = is_gtc_accepted
self._is_marketing_accepted = is_marketing_accepted
self._is_totp_enabled = is_totp_enabled
self._phone_number = phone_number
self._status = status
self._username = username
self.discriminator = None
@property
def address(self):
"""
Gets the address of this UserUpdateReq.
Address, not longer than 100 characters.
:return: The address of this UserUpdateReq.
:rtype: str
"""
return self._address
@address.setter
def address(self, address):
"""
Sets the address of this UserUpdateReq.
Address, not longer than 100 characters.
:param address: The address of this UserUpdateReq.
:type: str
"""
self._address = address
@property
def email(self):
"""
Gets the email of this UserUpdateReq.
The email address, not longer than 254 characters.
:return: The email of this UserUpdateReq.
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""
Sets the email of this UserUpdateReq.
The email address, not longer than 254 characters.
:param email: The email of this UserUpdateReq.
:type: str
"""
self._email = email
@property
def full_name(self):
"""
Gets the full_name of this UserUpdateReq.
The full name of the user, not longer than 100 characters.
:return: The full_name of this UserUpdateReq.
:rtype: str
"""
return self._full_name
@full_name.setter
def full_name(self, full_name):
"""
Sets the full_name of this UserUpdateReq.
The full name of the user, not longer than 100 characters.
:param full_name: The full_name of this UserUpdateReq.
:type: str
"""
self._full_name = full_name
@property
def groups(self):
"""
Gets the groups of this UserUpdateReq.
A list of group IDs this user belongs to.
:return: The groups of this UserUpdateReq.
:rtype: list[str]
"""
return self._groups
@groups.setter
def groups(self, groups):
"""
Sets the groups of this UserUpdateReq.
A list of group IDs this user belongs to.
:param groups: The groups of this UserUpdateReq.
:type: list[str]
"""
self._groups = groups
@property
def is_gtc_accepted(self):
"""
Gets the is_gtc_accepted of this UserUpdateReq.
A flag indicating that the General Terms and Conditions has been accepted.
:return: The is_gtc_accepted of this UserUpdateReq.
:rtype: bool
"""
return self._is_gtc_accepted
@is_gtc_accepted.setter
def is_gtc_accepted(self, is_gtc_accepted):
"""
Sets the is_gtc_accepted of this UserUpdateReq.
A flag indicating that the General Terms and Conditions has been accepted.
:param is_gtc_accepted: The is_gtc_accepted of this UserUpdateReq.
:type: bool
"""
self._is_gtc_accepted = is_gtc_accepted
@property
def is_marketing_accepted(self):
"""
Gets the is_marketing_accepted of this UserUpdateReq.
A flag indicating that receiving marketing information has been accepted.
:return: The is_marketing_accepted of this UserUpdateReq.
:rtype: bool
"""
return self._is_marketing_accepted
@is_marketing_accepted.setter
def is_marketing_accepted(self, is_marketing_accepted):
"""
Sets the is_marketing_accepted of this UserUpdateReq.
A flag indicating that receiving marketing information has been accepted.
:param is_marketing_accepted: The is_marketing_accepted of this UserUpdateReq.
:type: bool
"""
self._is_marketing_accepted = is_marketing_accepted
@property
def is_totp_enabled(self):
"""
Gets the is_totp_enabled of this UserUpdateReq.
A flag indicating whether 2-factor authentication (TOTP) has to be enabled or disabled.
:return: The is_totp_enabled of this UserUpdateReq.
:rtype: bool
"""
return self._is_totp_enabled
@is_totp_enabled.setter
def is_totp_enabled(self, is_totp_enabled):
"""
Sets the is_totp_enabled of this UserUpdateReq.
A flag indicating whether 2-factor authentication (TOTP) has to be enabled or disabled.
:param is_totp_enabled: The is_totp_enabled of this UserUpdateReq.
:type: bool
"""
self._is_totp_enabled = is_totp_enabled
@property
def phone_number(self):
"""
Gets the phone_number of this UserUpdateReq.
Phone number, not longer than 100 characters.
:return: The phone_number of this UserUpdateReq.
:rtype: str
"""
return self._phone_number
@phone_number.setter
def phone_number(self, phone_number):
"""
Sets the phone_number of this UserUpdateReq.
Phone number, not longer than 100 characters.
:param phone_number: The phone_number of this UserUpdateReq.
:type: str
"""
self._phone_number = phone_number
@property
def status(self):
"""
Gets the status of this UserUpdateReq.
The status of the user.
:return: The status of this UserUpdateReq.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this UserUpdateReq.
The status of the user.
:param status: The status of this UserUpdateReq.
:type: str
"""
self._status = status
@property
def username(self):
"""
Gets the username of this UserUpdateReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:return: The username of this UserUpdateReq.
:rtype: str
"""
return self._username
@username.setter
def username(self, username):
"""
Sets the username of this UserUpdateReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:param username: The username of this UserUpdateReq.
:type: str
"""
self._username = username
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UserUpdateReq):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UserUpdateReq(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, address=None, email=None, full_name=None, groups=None, is_gtc_accepted=None, is_marketing_accepted=None, is_totp_enabled=None, phone_number=None, status=None, username=None):
'''
UserUpdateReq - a model defined in Swagger
'''
pass
@property
def address(self):
'''
Gets the address of this UserUpdateReq.
Address, not longer than 100 characters.
:return: The address of this UserUpdateReq.
:rtype: str
'''
pass
@address.setter
def address(self):
'''
Sets the address of this UserUpdateReq.
Address, not longer than 100 characters.
:param address: The address of this UserUpdateReq.
:type: str
'''
pass
@property
def email(self):
'''
Gets the email of this UserUpdateReq.
The email address, not longer than 254 characters.
:return: The email of this UserUpdateReq.
:rtype: str
'''
pass
@email.setter
def email(self):
'''
Sets the email of this UserUpdateReq.
The email address, not longer than 254 characters.
:param email: The email of this UserUpdateReq.
:type: str
'''
pass
@property
def full_name(self):
'''
Gets the full_name of this UserUpdateReq.
The full name of the user, not longer than 100 characters.
:return: The full_name of this UserUpdateReq.
:rtype: str
'''
pass
@full_name.setter
def full_name(self):
'''
Sets the full_name of this UserUpdateReq.
The full name of the user, not longer than 100 characters.
:param full_name: The full_name of this UserUpdateReq.
:type: str
'''
pass
@property
def groups(self):
'''
Gets the groups of this UserUpdateReq.
A list of group IDs this user belongs to.
:return: The groups of this UserUpdateReq.
:rtype: list[str]
'''
pass
@groups.setter
def groups(self):
'''
Sets the groups of this UserUpdateReq.
A list of group IDs this user belongs to.
:param groups: The groups of this UserUpdateReq.
:type: list[str]
'''
pass
@property
def is_gtc_accepted(self):
'''
Gets the is_gtc_accepted of this UserUpdateReq.
A flag indicating that the General Terms and Conditions has been accepted.
:return: The is_gtc_accepted of this UserUpdateReq.
:rtype: bool
'''
pass
@is_gtc_accepted.setter
def is_gtc_accepted(self):
'''
Sets the is_gtc_accepted of this UserUpdateReq.
A flag indicating that the General Terms and Conditions has been accepted.
:param is_gtc_accepted: The is_gtc_accepted of this UserUpdateReq.
:type: bool
'''
pass
@property
def is_marketing_accepted(self):
'''
Gets the is_marketing_accepted of this UserUpdateReq.
A flag indicating that receiving marketing information has been accepted.
:return: The is_marketing_accepted of this UserUpdateReq.
:rtype: bool
'''
pass
@is_marketing_accepted.setter
def is_marketing_accepted(self):
'''
Sets the is_marketing_accepted of this UserUpdateReq.
A flag indicating that receiving marketing information has been accepted.
:param is_marketing_accepted: The is_marketing_accepted of this UserUpdateReq.
:type: bool
'''
pass
@property
def is_totp_enabled(self):
'''
Gets the is_totp_enabled of this UserUpdateReq.
A flag indicating whether 2-factor authentication (TOTP) has to be enabled or disabled.
:return: The is_totp_enabled of this UserUpdateReq.
:rtype: bool
'''
pass
@is_totp_enabled.setter
def is_totp_enabled(self):
'''
Sets the is_totp_enabled of this UserUpdateReq.
A flag indicating whether 2-factor authentication (TOTP) has to be enabled or disabled.
:param is_totp_enabled: The is_totp_enabled of this UserUpdateReq.
:type: bool
'''
pass
@property
def phone_number(self):
'''
Gets the phone_number of this UserUpdateReq.
Phone number, not longer than 100 characters.
:return: The phone_number of this UserUpdateReq.
:rtype: str
'''
pass
@phone_number.setter
def phone_number(self):
'''
Sets the phone_number of this UserUpdateReq.
Phone number, not longer than 100 characters.
:param phone_number: The phone_number of this UserUpdateReq.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this UserUpdateReq.
The status of the user.
:return: The status of this UserUpdateReq.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this UserUpdateReq.
The status of the user.
:param status: The status of this UserUpdateReq.
:type: str
'''
pass
@property
def username(self):
'''
Gets the username of this UserUpdateReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:return: The username of this UserUpdateReq.
:rtype: str
'''
pass
@username.setter
def username(self):
'''
Sets the username of this UserUpdateReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:param username: The username of this UserUpdateReq.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 47 | 27 | 10 | 1 | 3 | 5 | 1 | 1.17 | 1 | 3 | 0 | 0 | 26 | 11 | 26 | 26 | 339 | 63 | 127 | 63 | 80 | 149 | 75 | 43 | 48 | 5 | 1 | 2 | 31 |
2,557 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/user_invitation_resp_list.py
|
mbed_cloud._backends.iam.models.user_invitation_resp_list.UserInvitationRespList
|
class UserInvitationRespList(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[UserInvitationResp]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
UserInvitationRespList - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this UserInvitationRespList.
The entity ID to fetch after the given one.
:return: The after of this UserInvitationRespList.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this UserInvitationRespList.
The entity ID to fetch after the given one.
:param after: The after of this UserInvitationRespList.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this UserInvitationRespList.
A list of entities.
:return: The data of this UserInvitationRespList.
:rtype: list[UserInvitationResp]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this UserInvitationRespList.
A list of entities.
:param data: The data of this UserInvitationRespList.
:type: list[UserInvitationResp]
"""
if data is None:
raise ValueError("Invalid value for `data`, must not be `None`")
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this UserInvitationRespList.
Flag indicating whether there is more results.
:return: The has_more of this UserInvitationRespList.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this UserInvitationRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this UserInvitationRespList.
:type: bool
"""
if has_more is None:
raise ValueError("Invalid value for `has_more`, must not be `None`")
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this UserInvitationRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this UserInvitationRespList.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this UserInvitationRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this UserInvitationRespList.
:type: int
"""
if limit is None:
raise ValueError("Invalid value for `limit`, must not be `None`")
self._limit = limit
@property
def object(self):
"""
Gets the object of this UserInvitationRespList.
Entity name: always 'list'
:return: The object of this UserInvitationRespList.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UserInvitationRespList.
Entity name: always 'list'
:param object: The object of this UserInvitationRespList.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["list"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def order(self):
"""
Gets the order of this UserInvitationRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this UserInvitationRespList.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this UserInvitationRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this UserInvitationRespList.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this UserInvitationRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this UserInvitationRespList.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this UserInvitationRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this UserInvitationRespList.
:type: int
"""
if total_count is None:
raise ValueError("Invalid value for `total_count`, must not be `None`")
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UserInvitationRespList):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UserInvitationRespList(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
UserInvitationRespList - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this UserInvitationRespList.
The entity ID to fetch after the given one.
:return: The after of this UserInvitationRespList.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this UserInvitationRespList.
The entity ID to fetch after the given one.
:param after: The after of this UserInvitationRespList.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this UserInvitationRespList.
A list of entities.
:return: The data of this UserInvitationRespList.
:rtype: list[UserInvitationResp]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this UserInvitationRespList.
A list of entities.
:param data: The data of this UserInvitationRespList.
:type: list[UserInvitationResp]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this UserInvitationRespList.
Flag indicating whether there is more results.
:return: The has_more of this UserInvitationRespList.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this UserInvitationRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this UserInvitationRespList.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this UserInvitationRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this UserInvitationRespList.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this UserInvitationRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this UserInvitationRespList.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this UserInvitationRespList.
Entity name: always 'list'
:return: The object of this UserInvitationRespList.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UserInvitationRespList.
Entity name: always 'list'
:param object: The object of this UserInvitationRespList.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this UserInvitationRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this UserInvitationRespList.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this UserInvitationRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this UserInvitationRespList.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this UserInvitationRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this UserInvitationRespList.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this UserInvitationRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this UserInvitationRespList.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 11 | 1 | 4 | 5 | 2 | 0.93 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 283 | 48 | 122 | 50 | 87 | 113 | 76 | 36 | 55 | 5 | 1 | 2 | 32 |
2,558 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/user_invitation_resp.py
|
mbed_cloud._backends.iam.models.user_invitation_resp.UserInvitationResp
|
class UserInvitationResp(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account_id': 'str',
'created_at': 'datetime',
'email': 'str',
'etag': 'str',
'expiration': 'datetime',
'groups': 'list[str]',
'id': 'str',
'object': 'str',
'updated_at': 'datetime',
'user_id': 'str'
}
attribute_map = {
'account_id': 'account_id',
'created_at': 'created_at',
'email': 'email',
'etag': 'etag',
'expiration': 'expiration',
'groups': 'groups',
'id': 'id',
'object': 'object',
'updated_at': 'updated_at',
'user_id': 'user_id'
}
def __init__(self, account_id=None, created_at=None, email=None, etag=None, expiration=None, groups=None, id=None, object=None, updated_at=None, user_id=None):
"""
UserInvitationResp - a model defined in Swagger
"""
self._account_id = account_id
self._created_at = created_at
self._email = email
self._etag = etag
self._expiration = expiration
self._groups = groups
self._id = id
self._object = object
self._updated_at = updated_at
self._user_id = user_id
self.discriminator = None
@property
def account_id(self):
"""
Gets the account_id of this UserInvitationResp.
The UUID of the account the user is invited to.
:return: The account_id of this UserInvitationResp.
:rtype: str
"""
return self._account_id
@account_id.setter
def account_id(self, account_id):
"""
Sets the account_id of this UserInvitationResp.
The UUID of the account the user is invited to.
:param account_id: The account_id of this UserInvitationResp.
:type: str
"""
if account_id is None:
raise ValueError("Invalid value for `account_id`, must not be `None`")
self._account_id = account_id
@property
def created_at(self):
"""
Gets the created_at of this UserInvitationResp.
Creation UTC time RFC3339.
:return: The created_at of this UserInvitationResp.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this UserInvitationResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this UserInvitationResp.
:type: datetime
"""
if created_at is None:
raise ValueError("Invalid value for `created_at`, must not be `None`")
self._created_at = created_at
@property
def email(self):
"""
Gets the email of this UserInvitationResp.
Email address of the invited user.
:return: The email of this UserInvitationResp.
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""
Sets the email of this UserInvitationResp.
Email address of the invited user.
:param email: The email of this UserInvitationResp.
:type: str
"""
if email is None:
raise ValueError("Invalid value for `email`, must not be `None`")
self._email = email
@property
def etag(self):
"""
Gets the etag of this UserInvitationResp.
API resource entity version.
:return: The etag of this UserInvitationResp.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this UserInvitationResp.
API resource entity version.
:param etag: The etag of this UserInvitationResp.
:type: str
"""
if etag is None:
raise ValueError("Invalid value for `etag`, must not be `None`")
self._etag = etag
@property
def expiration(self):
"""
Gets the expiration of this UserInvitationResp.
Invitation expiration as UTC time RFC3339.
:return: The expiration of this UserInvitationResp.
:rtype: datetime
"""
return self._expiration
@expiration.setter
def expiration(self, expiration):
"""
Sets the expiration of this UserInvitationResp.
Invitation expiration as UTC time RFC3339.
:param expiration: The expiration of this UserInvitationResp.
:type: datetime
"""
self._expiration = expiration
@property
def groups(self):
"""
Gets the groups of this UserInvitationResp.
A list of IDs of the groups the user is invited to.
:return: The groups of this UserInvitationResp.
:rtype: list[str]
"""
return self._groups
@groups.setter
def groups(self, groups):
"""
Sets the groups of this UserInvitationResp.
A list of IDs of the groups the user is invited to.
:param groups: The groups of this UserInvitationResp.
:type: list[str]
"""
self._groups = groups
@property
def id(self):
"""
Gets the id of this UserInvitationResp.
The UUID of the invitation.
:return: The id of this UserInvitationResp.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this UserInvitationResp.
The UUID of the invitation.
:param id: The id of this UserInvitationResp.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def object(self):
"""
Gets the object of this UserInvitationResp.
Entity name: always 'user-invitation'
:return: The object of this UserInvitationResp.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UserInvitationResp.
Entity name: always 'user-invitation'
:param object: The object of this UserInvitationResp.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["user-invitation"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def updated_at(self):
"""
Gets the updated_at of this UserInvitationResp.
Last update UTC time RFC3339.
:return: The updated_at of this UserInvitationResp.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this UserInvitationResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this UserInvitationResp.
:type: datetime
"""
self._updated_at = updated_at
@property
def user_id(self):
"""
Gets the user_id of this UserInvitationResp.
The UUID of the invited user.
:return: The user_id of this UserInvitationResp.
:rtype: str
"""
return self._user_id
@user_id.setter
def user_id(self, user_id):
"""
Sets the user_id of this UserInvitationResp.
The UUID of the invited user.
:param user_id: The user_id of this UserInvitationResp.
:type: str
"""
if user_id is None:
raise ValueError("Invalid value for `user_id`, must not be `None`")
self._user_id = user_id
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UserInvitationResp):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UserInvitationResp(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, account_id=None, created_at=None, email=None, etag=None, expiration=None, groups=None, id=None, object=None, updated_at=None, user_id=None):
'''
UserInvitationResp - a model defined in Swagger
'''
pass
@property
def account_id(self):
'''
Gets the account_id of this UserInvitationResp.
The UUID of the account the user is invited to.
:return: The account_id of this UserInvitationResp.
:rtype: str
'''
pass
@account_id.setter
def account_id(self):
'''
Sets the account_id of this UserInvitationResp.
The UUID of the account the user is invited to.
:param account_id: The account_id of this UserInvitationResp.
:type: str
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this UserInvitationResp.
Creation UTC time RFC3339.
:return: The created_at of this UserInvitationResp.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this UserInvitationResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this UserInvitationResp.
:type: datetime
'''
pass
@property
def email(self):
'''
Gets the email of this UserInvitationResp.
Email address of the invited user.
:return: The email of this UserInvitationResp.
:rtype: str
'''
pass
@email.setter
def email(self):
'''
Sets the email of this UserInvitationResp.
Email address of the invited user.
:param email: The email of this UserInvitationResp.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this UserInvitationResp.
API resource entity version.
:return: The etag of this UserInvitationResp.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this UserInvitationResp.
API resource entity version.
:param etag: The etag of this UserInvitationResp.
:type: str
'''
pass
@property
def expiration(self):
'''
Gets the expiration of this UserInvitationResp.
Invitation expiration as UTC time RFC3339.
:return: The expiration of this UserInvitationResp.
:rtype: datetime
'''
pass
@expiration.setter
def expiration(self):
'''
Sets the expiration of this UserInvitationResp.
Invitation expiration as UTC time RFC3339.
:param expiration: The expiration of this UserInvitationResp.
:type: datetime
'''
pass
@property
def groups(self):
'''
Gets the groups of this UserInvitationResp.
A list of IDs of the groups the user is invited to.
:return: The groups of this UserInvitationResp.
:rtype: list[str]
'''
pass
@groups.setter
def groups(self):
'''
Sets the groups of this UserInvitationResp.
A list of IDs of the groups the user is invited to.
:param groups: The groups of this UserInvitationResp.
:type: list[str]
'''
pass
@property
def id(self):
'''
Gets the id of this UserInvitationResp.
The UUID of the invitation.
:return: The id of this UserInvitationResp.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this UserInvitationResp.
The UUID of the invitation.
:param id: The id of this UserInvitationResp.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this UserInvitationResp.
Entity name: always 'user-invitation'
:return: The object of this UserInvitationResp.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UserInvitationResp.
Entity name: always 'user-invitation'
:param object: The object of this UserInvitationResp.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this UserInvitationResp.
Last update UTC time RFC3339.
:return: The updated_at of this UserInvitationResp.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this UserInvitationResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this UserInvitationResp.
:type: datetime
'''
pass
@property
def user_id(self):
'''
Gets the user_id of this UserInvitationResp.
The UUID of the invited user.
:return: The user_id of this UserInvitationResp.
:rtype: str
'''
pass
@user_id.setter
def user_id(self):
'''
Sets the user_id of this UserInvitationResp.
The UUID of the invited user.
:param user_id: The user_id of this UserInvitationResp.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 47 | 27 | 11 | 1 | 4 | 5 | 2 | 1.01 | 1 | 4 | 0 | 0 | 26 | 11 | 26 | 26 | 359 | 63 | 147 | 64 | 100 | 149 | 92 | 44 | 65 | 5 | 1 | 2 | 39 |
2,559 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/user_invitation_req.py
|
mbed_cloud._backends.iam.models.user_invitation_req.UserInvitationReq
|
class UserInvitationReq(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'email': 'str'
}
attribute_map = {
'email': 'email'
}
def __init__(self, email=None):
"""
UserInvitationReq - a model defined in Swagger
"""
self._email = email
self.discriminator = None
@property
def email(self):
"""
Gets the email of this UserInvitationReq.
The email address, not longer than 254 characters.
:return: The email of this UserInvitationReq.
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""
Sets the email of this UserInvitationReq.
The email address, not longer than 254 characters.
:param email: The email of this UserInvitationReq.
:type: str
"""
if email is None:
raise ValueError("Invalid value for `email`, must not be `None`")
self._email = email
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UserInvitationReq):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UserInvitationReq(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, email=None):
'''
UserInvitationReq - a model defined in Swagger
'''
pass
@property
def email(self):
'''
Gets the email of this UserInvitationReq.
The email address, not longer than 254 characters.
:return: The email of this UserInvitationReq.
:rtype: str
'''
pass
@email.setter
def email(self):
'''
Sets the email of this UserInvitationReq.
The email address, not longer than 254 characters.
:param email: The email of this UserInvitationReq.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 11 | 9 | 10 | 1 | 5 | 4 | 2 | 0.85 | 1 | 4 | 0 | 0 | 8 | 2 | 8 | 8 | 107 | 18 | 48 | 18 | 37 | 41 | 32 | 16 | 23 | 5 | 1 | 2 | 14 |
2,560 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/user_info_resp_list.py
|
mbed_cloud._backends.iam.models.user_info_resp_list.UserInfoRespList
|
class UserInfoRespList(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[UserInfoResp]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
UserInfoRespList - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this UserInfoRespList.
The entity ID to fetch after the given one.
:return: The after of this UserInfoRespList.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this UserInfoRespList.
The entity ID to fetch after the given one.
:param after: The after of this UserInfoRespList.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this UserInfoRespList.
A list of entities.
:return: The data of this UserInfoRespList.
:rtype: list[UserInfoResp]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this UserInfoRespList.
A list of entities.
:param data: The data of this UserInfoRespList.
:type: list[UserInfoResp]
"""
if data is None:
raise ValueError("Invalid value for `data`, must not be `None`")
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this UserInfoRespList.
Flag indicating whether there is more results.
:return: The has_more of this UserInfoRespList.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this UserInfoRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this UserInfoRespList.
:type: bool
"""
if has_more is None:
raise ValueError("Invalid value for `has_more`, must not be `None`")
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this UserInfoRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this UserInfoRespList.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this UserInfoRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this UserInfoRespList.
:type: int
"""
if limit is None:
raise ValueError("Invalid value for `limit`, must not be `None`")
self._limit = limit
@property
def object(self):
"""
Gets the object of this UserInfoRespList.
Entity name: always 'list'
:return: The object of this UserInfoRespList.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UserInfoRespList.
Entity name: always 'list'
:param object: The object of this UserInfoRespList.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["list"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def order(self):
"""
Gets the order of this UserInfoRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this UserInfoRespList.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this UserInfoRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this UserInfoRespList.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this UserInfoRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this UserInfoRespList.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this UserInfoRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this UserInfoRespList.
:type: int
"""
if total_count is None:
raise ValueError("Invalid value for `total_count`, must not be `None`")
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UserInfoRespList):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UserInfoRespList(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
UserInfoRespList - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this UserInfoRespList.
The entity ID to fetch after the given one.
:return: The after of this UserInfoRespList.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this UserInfoRespList.
The entity ID to fetch after the given one.
:param after: The after of this UserInfoRespList.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this UserInfoRespList.
A list of entities.
:return: The data of this UserInfoRespList.
:rtype: list[UserInfoResp]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this UserInfoRespList.
A list of entities.
:param data: The data of this UserInfoRespList.
:type: list[UserInfoResp]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this UserInfoRespList.
Flag indicating whether there is more results.
:return: The has_more of this UserInfoRespList.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this UserInfoRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this UserInfoRespList.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this UserInfoRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this UserInfoRespList.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this UserInfoRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this UserInfoRespList.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this UserInfoRespList.
Entity name: always 'list'
:return: The object of this UserInfoRespList.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UserInfoRespList.
Entity name: always 'list'
:param object: The object of this UserInfoRespList.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this UserInfoRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this UserInfoRespList.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this UserInfoRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this UserInfoRespList.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this UserInfoRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this UserInfoRespList.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this UserInfoRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this UserInfoRespList.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 11 | 1 | 4 | 5 | 2 | 0.93 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 283 | 48 | 122 | 50 | 87 | 113 | 76 | 36 | 55 | 5 | 1 | 2 | 32 |
2,561 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/user_info_resp.py
|
mbed_cloud._backends.iam.models.user_info_resp.UserInfoResp
|
class UserInfoResp(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account_id': 'str',
'address': 'str',
'created_at': 'datetime',
'creation_time': 'int',
'email': 'str',
'email_verified': 'bool',
'etag': 'str',
'full_name': 'str',
'groups': 'list[str]',
'id': 'str',
'is_gtc_accepted': 'bool',
'is_marketing_accepted': 'bool',
'is_totp_enabled': 'bool',
'last_login_time': 'int',
'login_history': 'list[LoginHistory]',
'object': 'str',
'password': 'str',
'password_changed_time': 'int',
'phone_number': 'str',
'status': 'str',
'updated_at': 'datetime',
'username': 'str'
}
attribute_map = {
'account_id': 'account_id',
'address': 'address',
'created_at': 'created_at',
'creation_time': 'creation_time',
'email': 'email',
'email_verified': 'email_verified',
'etag': 'etag',
'full_name': 'full_name',
'groups': 'groups',
'id': 'id',
'is_gtc_accepted': 'is_gtc_accepted',
'is_marketing_accepted': 'is_marketing_accepted',
'is_totp_enabled': 'is_totp_enabled',
'last_login_time': 'last_login_time',
'login_history': 'login_history',
'object': 'object',
'password': 'password',
'password_changed_time': 'password_changed_time',
'phone_number': 'phone_number',
'status': 'status',
'updated_at': 'updated_at',
'username': 'username'
}
def __init__(self, account_id=None, address=None, created_at=None, creation_time=None, email=None, email_verified=None, etag=None, full_name=None, groups=None, id=None, is_gtc_accepted=None, is_marketing_accepted=None, is_totp_enabled=None, last_login_time=None, login_history=None, object=None, password=None, password_changed_time=None, phone_number=None, status=None, updated_at=None, username=None):
"""
UserInfoResp - a model defined in Swagger
"""
self._account_id = account_id
self._address = address
self._created_at = created_at
self._creation_time = creation_time
self._email = email
self._email_verified = email_verified
self._etag = etag
self._full_name = full_name
self._groups = groups
self._id = id
self._is_gtc_accepted = is_gtc_accepted
self._is_marketing_accepted = is_marketing_accepted
self._is_totp_enabled = is_totp_enabled
self._last_login_time = last_login_time
self._login_history = login_history
self._object = object
self._password = password
self._password_changed_time = password_changed_time
self._phone_number = phone_number
self._status = status
self._updated_at = updated_at
self._username = username
self.discriminator = None
@property
def account_id(self):
"""
Gets the account_id of this UserInfoResp.
The UUID of the account.
:return: The account_id of this UserInfoResp.
:rtype: str
"""
return self._account_id
@account_id.setter
def account_id(self, account_id):
"""
Sets the account_id of this UserInfoResp.
The UUID of the account.
:param account_id: The account_id of this UserInfoResp.
:type: str
"""
if account_id is None:
raise ValueError("Invalid value for `account_id`, must not be `None`")
self._account_id = account_id
@property
def address(self):
"""
Gets the address of this UserInfoResp.
Address.
:return: The address of this UserInfoResp.
:rtype: str
"""
return self._address
@address.setter
def address(self, address):
"""
Sets the address of this UserInfoResp.
Address.
:param address: The address of this UserInfoResp.
:type: str
"""
self._address = address
@property
def created_at(self):
"""
Gets the created_at of this UserInfoResp.
Creation UTC time RFC3339.
:return: The created_at of this UserInfoResp.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this UserInfoResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this UserInfoResp.
:type: datetime
"""
self._created_at = created_at
@property
def creation_time(self):
"""
Gets the creation_time of this UserInfoResp.
A timestamp of the user creation in the storage, in milliseconds.
:return: The creation_time of this UserInfoResp.
:rtype: int
"""
return self._creation_time
@creation_time.setter
def creation_time(self, creation_time):
"""
Sets the creation_time of this UserInfoResp.
A timestamp of the user creation in the storage, in milliseconds.
:param creation_time: The creation_time of this UserInfoResp.
:type: int
"""
self._creation_time = creation_time
@property
def email(self):
"""
Gets the email of this UserInfoResp.
The email address.
:return: The email of this UserInfoResp.
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""
Sets the email of this UserInfoResp.
The email address.
:param email: The email of this UserInfoResp.
:type: str
"""
if email is None:
raise ValueError("Invalid value for `email`, must not be `None`")
self._email = email
@property
def email_verified(self):
"""
Gets the email_verified of this UserInfoResp.
A flag indicating whether the user's email address has been verified or not.
:return: The email_verified of this UserInfoResp.
:rtype: bool
"""
return self._email_verified
@email_verified.setter
def email_verified(self, email_verified):
"""
Sets the email_verified of this UserInfoResp.
A flag indicating whether the user's email address has been verified or not.
:param email_verified: The email_verified of this UserInfoResp.
:type: bool
"""
self._email_verified = email_verified
@property
def etag(self):
"""
Gets the etag of this UserInfoResp.
API resource entity version.
:return: The etag of this UserInfoResp.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this UserInfoResp.
API resource entity version.
:param etag: The etag of this UserInfoResp.
:type: str
"""
if etag is None:
raise ValueError("Invalid value for `etag`, must not be `None`")
self._etag = etag
@property
def full_name(self):
"""
Gets the full_name of this UserInfoResp.
The full name of the user.
:return: The full_name of this UserInfoResp.
:rtype: str
"""
return self._full_name
@full_name.setter
def full_name(self, full_name):
"""
Sets the full_name of this UserInfoResp.
The full name of the user.
:param full_name: The full_name of this UserInfoResp.
:type: str
"""
self._full_name = full_name
@property
def groups(self):
"""
Gets the groups of this UserInfoResp.
A list of IDs of the groups this user belongs to.
:return: The groups of this UserInfoResp.
:rtype: list[str]
"""
return self._groups
@groups.setter
def groups(self, groups):
"""
Sets the groups of this UserInfoResp.
A list of IDs of the groups this user belongs to.
:param groups: The groups of this UserInfoResp.
:type: list[str]
"""
self._groups = groups
@property
def id(self):
"""
Gets the id of this UserInfoResp.
The UUID of the user.
:return: The id of this UserInfoResp.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this UserInfoResp.
The UUID of the user.
:param id: The id of this UserInfoResp.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def is_gtc_accepted(self):
"""
Gets the is_gtc_accepted of this UserInfoResp.
A flag indicating that the General Terms and Conditions has been accepted.
:return: The is_gtc_accepted of this UserInfoResp.
:rtype: bool
"""
return self._is_gtc_accepted
@is_gtc_accepted.setter
def is_gtc_accepted(self, is_gtc_accepted):
"""
Sets the is_gtc_accepted of this UserInfoResp.
A flag indicating that the General Terms and Conditions has been accepted.
:param is_gtc_accepted: The is_gtc_accepted of this UserInfoResp.
:type: bool
"""
self._is_gtc_accepted = is_gtc_accepted
@property
def is_marketing_accepted(self):
"""
Gets the is_marketing_accepted of this UserInfoResp.
A flag indicating that receiving marketing information has been accepted.
:return: The is_marketing_accepted of this UserInfoResp.
:rtype: bool
"""
return self._is_marketing_accepted
@is_marketing_accepted.setter
def is_marketing_accepted(self, is_marketing_accepted):
"""
Sets the is_marketing_accepted of this UserInfoResp.
A flag indicating that receiving marketing information has been accepted.
:param is_marketing_accepted: The is_marketing_accepted of this UserInfoResp.
:type: bool
"""
self._is_marketing_accepted = is_marketing_accepted
@property
def is_totp_enabled(self):
"""
Gets the is_totp_enabled of this UserInfoResp.
A flag indicating whether 2-factor authentication (TOTP) has been enabled.
:return: The is_totp_enabled of this UserInfoResp.
:rtype: bool
"""
return self._is_totp_enabled
@is_totp_enabled.setter
def is_totp_enabled(self, is_totp_enabled):
"""
Sets the is_totp_enabled of this UserInfoResp.
A flag indicating whether 2-factor authentication (TOTP) has been enabled.
:param is_totp_enabled: The is_totp_enabled of this UserInfoResp.
:type: bool
"""
self._is_totp_enabled = is_totp_enabled
@property
def last_login_time(self):
"""
Gets the last_login_time of this UserInfoResp.
A timestamp of the latest login of the user, in milliseconds.
:return: The last_login_time of this UserInfoResp.
:rtype: int
"""
return self._last_login_time
@last_login_time.setter
def last_login_time(self, last_login_time):
"""
Sets the last_login_time of this UserInfoResp.
A timestamp of the latest login of the user, in milliseconds.
:param last_login_time: The last_login_time of this UserInfoResp.
:type: int
"""
self._last_login_time = last_login_time
@property
def login_history(self):
"""
Gets the login_history of this UserInfoResp.
Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.
:return: The login_history of this UserInfoResp.
:rtype: list[LoginHistory]
"""
return self._login_history
@login_history.setter
def login_history(self, login_history):
"""
Sets the login_history of this UserInfoResp.
Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.
:param login_history: The login_history of this UserInfoResp.
:type: list[LoginHistory]
"""
self._login_history = login_history
@property
def object(self):
"""
Gets the object of this UserInfoResp.
Entity name: always 'user'
:return: The object of this UserInfoResp.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UserInfoResp.
Entity name: always 'user'
:param object: The object of this UserInfoResp.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["user"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def password(self):
"""
Gets the password of this UserInfoResp.
The password when creating a new user. It will be generated when not present in the request.
:return: The password of this UserInfoResp.
:rtype: str
"""
return self._password
@password.setter
def password(self, password):
"""
Sets the password of this UserInfoResp.
The password when creating a new user. It will be generated when not present in the request.
:param password: The password of this UserInfoResp.
:type: str
"""
self._password = password
@property
def password_changed_time(self):
"""
Gets the password_changed_time of this UserInfoResp.
A timestamp of the latest change of the user password, in milliseconds.
:return: The password_changed_time of this UserInfoResp.
:rtype: int
"""
return self._password_changed_time
@password_changed_time.setter
def password_changed_time(self, password_changed_time):
"""
Sets the password_changed_time of this UserInfoResp.
A timestamp of the latest change of the user password, in milliseconds.
:param password_changed_time: The password_changed_time of this UserInfoResp.
:type: int
"""
self._password_changed_time = password_changed_time
@property
def phone_number(self):
"""
Gets the phone_number of this UserInfoResp.
Phone number.
:return: The phone_number of this UserInfoResp.
:rtype: str
"""
return self._phone_number
@phone_number.setter
def phone_number(self, phone_number):
"""
Sets the phone_number of this UserInfoResp.
Phone number.
:param phone_number: The phone_number of this UserInfoResp.
:type: str
"""
self._phone_number = phone_number
@property
def status(self):
"""
Gets the status of this UserInfoResp.
The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.
:return: The status of this UserInfoResp.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this UserInfoResp.
The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.
:param status: The status of this UserInfoResp.
:type: str
"""
if status is None:
raise ValueError("Invalid value for `status`, must not be `None`")
allowed_values = ["ENROLLING", "INVITED", "ACTIVE", "RESET", "INACTIVE"]
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}"
.format(status, allowed_values)
)
self._status = status
@property
def updated_at(self):
"""
Gets the updated_at of this UserInfoResp.
Last update UTC time RFC3339.
:return: The updated_at of this UserInfoResp.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this UserInfoResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this UserInfoResp.
:type: datetime
"""
self._updated_at = updated_at
@property
def username(self):
"""
Gets the username of this UserInfoResp.
A username containing alphanumerical letters and -,._@+= characters.
:return: The username of this UserInfoResp.
:rtype: str
"""
return self._username
@username.setter
def username(self, username):
"""
Sets the username of this UserInfoResp.
A username containing alphanumerical letters and -,._@+= characters.
:param username: The username of this UserInfoResp.
:type: str
"""
self._username = username
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UserInfoResp):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UserInfoResp(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, account_id=None, address=None, created_at=None, creation_time=None, email=None, email_verified=None, etag=None, full_name=None, groups=None, id=None, is_gtc_accepted=None, is_marketing_accepted=None, is_totp_enabled=None, last_login_time=None, login_history=None, object=None, password=None, password_changed_time=None, phone_number=None, status=None, updated_at=None, username=None):
'''
UserInfoResp - a model defined in Swagger
'''
pass
@property
def account_id(self):
'''
Gets the account_id of this UserInfoResp.
The UUID of the account.
:return: The account_id of this UserInfoResp.
:rtype: str
'''
pass
@account_id.setter
def account_id(self):
'''
Sets the account_id of this UserInfoResp.
The UUID of the account.
:param account_id: The account_id of this UserInfoResp.
:type: str
'''
pass
@property
def address(self):
'''
Gets the address of this UserInfoResp.
Address.
:return: The address of this UserInfoResp.
:rtype: str
'''
pass
@address.setter
def address(self):
'''
Sets the address of this UserInfoResp.
Address.
:param address: The address of this UserInfoResp.
:type: str
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this UserInfoResp.
Creation UTC time RFC3339.
:return: The created_at of this UserInfoResp.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this UserInfoResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this UserInfoResp.
:type: datetime
'''
pass
@property
def creation_time(self):
'''
Gets the creation_time of this UserInfoResp.
A timestamp of the user creation in the storage, in milliseconds.
:return: The creation_time of this UserInfoResp.
:rtype: int
'''
pass
@creation_time.setter
def creation_time(self):
'''
Sets the creation_time of this UserInfoResp.
A timestamp of the user creation in the storage, in milliseconds.
:param creation_time: The creation_time of this UserInfoResp.
:type: int
'''
pass
@property
def email(self):
'''
Gets the email of this UserInfoResp.
The email address.
:return: The email of this UserInfoResp.
:rtype: str
'''
pass
@email.setter
def email(self):
'''
Sets the email of this UserInfoResp.
The email address.
:param email: The email of this UserInfoResp.
:type: str
'''
pass
@property
def email_verified(self):
'''
Gets the email_verified of this UserInfoResp.
A flag indicating whether the user's email address has been verified or not.
:return: The email_verified of this UserInfoResp.
:rtype: bool
'''
pass
@email_verified.setter
def email_verified(self):
'''
Sets the email_verified of this UserInfoResp.
A flag indicating whether the user's email address has been verified or not.
:param email_verified: The email_verified of this UserInfoResp.
:type: bool
'''
pass
@property
def etag(self):
'''
Gets the etag of this UserInfoResp.
API resource entity version.
:return: The etag of this UserInfoResp.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this UserInfoResp.
API resource entity version.
:param etag: The etag of this UserInfoResp.
:type: str
'''
pass
@property
def full_name(self):
'''
Gets the full_name of this UserInfoResp.
The full name of the user.
:return: The full_name of this UserInfoResp.
:rtype: str
'''
pass
@full_name.setter
def full_name(self):
'''
Sets the full_name of this UserInfoResp.
The full name of the user.
:param full_name: The full_name of this UserInfoResp.
:type: str
'''
pass
@property
def groups(self):
'''
Gets the groups of this UserInfoResp.
A list of IDs of the groups this user belongs to.
:return: The groups of this UserInfoResp.
:rtype: list[str]
'''
pass
@groups.setter
def groups(self):
'''
Sets the groups of this UserInfoResp.
A list of IDs of the groups this user belongs to.
:param groups: The groups of this UserInfoResp.
:type: list[str]
'''
pass
@property
def id(self):
'''
Gets the id of this UserInfoResp.
The UUID of the user.
:return: The id of this UserInfoResp.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this UserInfoResp.
The UUID of the user.
:param id: The id of this UserInfoResp.
:type: str
'''
pass
@property
def is_gtc_accepted(self):
'''
Gets the is_gtc_accepted of this UserInfoResp.
A flag indicating that the General Terms and Conditions has been accepted.
:return: The is_gtc_accepted of this UserInfoResp.
:rtype: bool
'''
pass
@is_gtc_accepted.setter
def is_gtc_accepted(self):
'''
Sets the is_gtc_accepted of this UserInfoResp.
A flag indicating that the General Terms and Conditions has been accepted.
:param is_gtc_accepted: The is_gtc_accepted of this UserInfoResp.
:type: bool
'''
pass
@property
def is_marketing_accepted(self):
'''
Gets the is_marketing_accepted of this UserInfoResp.
A flag indicating that receiving marketing information has been accepted.
:return: The is_marketing_accepted of this UserInfoResp.
:rtype: bool
'''
pass
@is_marketing_accepted.setter
def is_marketing_accepted(self):
'''
Sets the is_marketing_accepted of this UserInfoResp.
A flag indicating that receiving marketing information has been accepted.
:param is_marketing_accepted: The is_marketing_accepted of this UserInfoResp.
:type: bool
'''
pass
@property
def is_totp_enabled(self):
'''
Gets the is_totp_enabled of this UserInfoResp.
A flag indicating whether 2-factor authentication (TOTP) has been enabled.
:return: The is_totp_enabled of this UserInfoResp.
:rtype: bool
'''
pass
@is_totp_enabled.setter
def is_totp_enabled(self):
'''
Sets the is_totp_enabled of this UserInfoResp.
A flag indicating whether 2-factor authentication (TOTP) has been enabled.
:param is_totp_enabled: The is_totp_enabled of this UserInfoResp.
:type: bool
'''
pass
@property
def last_login_time(self):
'''
Gets the last_login_time of this UserInfoResp.
A timestamp of the latest login of the user, in milliseconds.
:return: The last_login_time of this UserInfoResp.
:rtype: int
'''
pass
@last_login_time.setter
def last_login_time(self):
'''
Sets the last_login_time of this UserInfoResp.
A timestamp of the latest login of the user, in milliseconds.
:param last_login_time: The last_login_time of this UserInfoResp.
:type: int
'''
pass
@property
def login_history(self):
'''
Gets the login_history of this UserInfoResp.
Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.
:return: The login_history of this UserInfoResp.
:rtype: list[LoginHistory]
'''
pass
@login_history.setter
def login_history(self):
'''
Sets the login_history of this UserInfoResp.
Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.
:param login_history: The login_history of this UserInfoResp.
:type: list[LoginHistory]
'''
pass
@property
def object(self):
'''
Gets the object of this UserInfoResp.
Entity name: always 'user'
:return: The object of this UserInfoResp.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UserInfoResp.
Entity name: always 'user'
:param object: The object of this UserInfoResp.
:type: str
'''
pass
@property
def password(self):
'''
Gets the password of this UserInfoResp.
The password when creating a new user. It will be generated when not present in the request.
:return: The password of this UserInfoResp.
:rtype: str
'''
pass
@password.setter
def password(self):
'''
Sets the password of this UserInfoResp.
The password when creating a new user. It will be generated when not present in the request.
:param password: The password of this UserInfoResp.
:type: str
'''
pass
@property
def password_changed_time(self):
'''
Gets the password_changed_time of this UserInfoResp.
A timestamp of the latest change of the user password, in milliseconds.
:return: The password_changed_time of this UserInfoResp.
:rtype: int
'''
pass
@password_changed_time.setter
def password_changed_time(self):
'''
Sets the password_changed_time of this UserInfoResp.
A timestamp of the latest change of the user password, in milliseconds.
:param password_changed_time: The password_changed_time of this UserInfoResp.
:type: int
'''
pass
@property
def phone_number(self):
'''
Gets the phone_number of this UserInfoResp.
Phone number.
:return: The phone_number of this UserInfoResp.
:rtype: str
'''
pass
@phone_number.setter
def phone_number(self):
'''
Sets the phone_number of this UserInfoResp.
Phone number.
:param phone_number: The phone_number of this UserInfoResp.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this UserInfoResp.
The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.
:return: The status of this UserInfoResp.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this UserInfoResp.
The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.
:param status: The status of this UserInfoResp.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this UserInfoResp.
Last update UTC time RFC3339.
:return: The updated_at of this UserInfoResp.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this UserInfoResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this UserInfoResp.
:type: datetime
'''
pass
@property
def username(self):
'''
Gets the username of this UserInfoResp.
A username containing alphanumerical letters and -,._@+= characters.
:return: The username of this UserInfoResp.
:rtype: str
'''
pass
@username.setter
def username(self):
'''
Sets the username of this UserInfoResp.
A username containing alphanumerical letters and -,._@+= characters.
:param username: The username of this UserInfoResp.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 95 | 51 | 10 | 1 | 3 | 6 | 1 | 1.13 | 1 | 4 | 0 | 0 | 50 | 23 | 50 | 50 | 675 | 123 | 259 | 125 | 164 | 293 | 153 | 81 | 102 | 5 | 1 | 2 | 63 |
2,562 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/user_info_req.py
|
mbed_cloud._backends.iam.models.user_info_req.UserInfoReq
|
class UserInfoReq(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'address': 'str',
'email': 'str',
'full_name': 'str',
'groups': 'list[str]',
'is_gtc_accepted': 'bool',
'is_marketing_accepted': 'bool',
'password': 'str',
'phone_number': 'str',
'username': 'str'
}
attribute_map = {
'address': 'address',
'email': 'email',
'full_name': 'full_name',
'groups': 'groups',
'is_gtc_accepted': 'is_gtc_accepted',
'is_marketing_accepted': 'is_marketing_accepted',
'password': 'password',
'phone_number': 'phone_number',
'username': 'username'
}
def __init__(self, address=None, email=None, full_name=None, groups=None, is_gtc_accepted=None, is_marketing_accepted=None, password=None, phone_number=None, username=None):
"""
UserInfoReq - a model defined in Swagger
"""
self._address = address
self._email = email
self._full_name = full_name
self._groups = groups
self._is_gtc_accepted = is_gtc_accepted
self._is_marketing_accepted = is_marketing_accepted
self._password = password
self._phone_number = phone_number
self._username = username
self.discriminator = None
@property
def address(self):
"""
Gets the address of this UserInfoReq.
Address, not longer than 100 characters.
:return: The address of this UserInfoReq.
:rtype: str
"""
return self._address
@address.setter
def address(self, address):
"""
Sets the address of this UserInfoReq.
Address, not longer than 100 characters.
:param address: The address of this UserInfoReq.
:type: str
"""
self._address = address
@property
def email(self):
"""
Gets the email of this UserInfoReq.
The email address, not longer than 254 characters.
:return: The email of this UserInfoReq.
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""
Sets the email of this UserInfoReq.
The email address, not longer than 254 characters.
:param email: The email of this UserInfoReq.
:type: str
"""
if email is None:
raise ValueError("Invalid value for `email`, must not be `None`")
self._email = email
@property
def full_name(self):
"""
Gets the full_name of this UserInfoReq.
The full name of the user, not longer than 100 characters.
:return: The full_name of this UserInfoReq.
:rtype: str
"""
return self._full_name
@full_name.setter
def full_name(self, full_name):
"""
Sets the full_name of this UserInfoReq.
The full name of the user, not longer than 100 characters.
:param full_name: The full_name of this UserInfoReq.
:type: str
"""
self._full_name = full_name
@property
def groups(self):
"""
Gets the groups of this UserInfoReq.
A list of IDs of the groups this user belongs to.
:return: The groups of this UserInfoReq.
:rtype: list[str]
"""
return self._groups
@groups.setter
def groups(self, groups):
"""
Sets the groups of this UserInfoReq.
A list of IDs of the groups this user belongs to.
:param groups: The groups of this UserInfoReq.
:type: list[str]
"""
self._groups = groups
@property
def is_gtc_accepted(self):
"""
Gets the is_gtc_accepted of this UserInfoReq.
A flag indicating that the General Terms and Conditions has been accepted.
:return: The is_gtc_accepted of this UserInfoReq.
:rtype: bool
"""
return self._is_gtc_accepted
@is_gtc_accepted.setter
def is_gtc_accepted(self, is_gtc_accepted):
"""
Sets the is_gtc_accepted of this UserInfoReq.
A flag indicating that the General Terms and Conditions has been accepted.
:param is_gtc_accepted: The is_gtc_accepted of this UserInfoReq.
:type: bool
"""
self._is_gtc_accepted = is_gtc_accepted
@property
def is_marketing_accepted(self):
"""
Gets the is_marketing_accepted of this UserInfoReq.
A flag indicating that receiving marketing information has been accepted.
:return: The is_marketing_accepted of this UserInfoReq.
:rtype: bool
"""
return self._is_marketing_accepted
@is_marketing_accepted.setter
def is_marketing_accepted(self, is_marketing_accepted):
"""
Sets the is_marketing_accepted of this UserInfoReq.
A flag indicating that receiving marketing information has been accepted.
:param is_marketing_accepted: The is_marketing_accepted of this UserInfoReq.
:type: bool
"""
self._is_marketing_accepted = is_marketing_accepted
@property
def password(self):
"""
Gets the password of this UserInfoReq.
The password when creating a new user. It will be generated when not present in the request.
:return: The password of this UserInfoReq.
:rtype: str
"""
return self._password
@password.setter
def password(self, password):
"""
Sets the password of this UserInfoReq.
The password when creating a new user. It will be generated when not present in the request.
:param password: The password of this UserInfoReq.
:type: str
"""
self._password = password
@property
def phone_number(self):
"""
Gets the phone_number of this UserInfoReq.
Phone number, not longer than 100 characters.
:return: The phone_number of this UserInfoReq.
:rtype: str
"""
return self._phone_number
@phone_number.setter
def phone_number(self, phone_number):
"""
Sets the phone_number of this UserInfoReq.
Phone number, not longer than 100 characters.
:param phone_number: The phone_number of this UserInfoReq.
:type: str
"""
self._phone_number = phone_number
@property
def username(self):
"""
Gets the username of this UserInfoReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:return: The username of this UserInfoReq.
:rtype: str
"""
return self._username
@username.setter
def username(self, username):
"""
Sets the username of this UserInfoReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:param username: The username of this UserInfoReq.
:type: str
"""
self._username = username
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UserInfoReq):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UserInfoReq(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, address=None, email=None, full_name=None, groups=None, is_gtc_accepted=None, is_marketing_accepted=None, password=None, phone_number=None, username=None):
'''
UserInfoReq - a model defined in Swagger
'''
pass
@property
def address(self):
'''
Gets the address of this UserInfoReq.
Address, not longer than 100 characters.
:return: The address of this UserInfoReq.
:rtype: str
'''
pass
@address.setter
def address(self):
'''
Sets the address of this UserInfoReq.
Address, not longer than 100 characters.
:param address: The address of this UserInfoReq.
:type: str
'''
pass
@property
def email(self):
'''
Gets the email of this UserInfoReq.
The email address, not longer than 254 characters.
:return: The email of this UserInfoReq.
:rtype: str
'''
pass
@email.setter
def email(self):
'''
Sets the email of this UserInfoReq.
The email address, not longer than 254 characters.
:param email: The email of this UserInfoReq.
:type: str
'''
pass
@property
def full_name(self):
'''
Gets the full_name of this UserInfoReq.
The full name of the user, not longer than 100 characters.
:return: The full_name of this UserInfoReq.
:rtype: str
'''
pass
@full_name.setter
def full_name(self):
'''
Sets the full_name of this UserInfoReq.
The full name of the user, not longer than 100 characters.
:param full_name: The full_name of this UserInfoReq.
:type: str
'''
pass
@property
def groups(self):
'''
Gets the groups of this UserInfoReq.
A list of IDs of the groups this user belongs to.
:return: The groups of this UserInfoReq.
:rtype: list[str]
'''
pass
@groups.setter
def groups(self):
'''
Sets the groups of this UserInfoReq.
A list of IDs of the groups this user belongs to.
:param groups: The groups of this UserInfoReq.
:type: list[str]
'''
pass
@property
def is_gtc_accepted(self):
'''
Gets the is_gtc_accepted of this UserInfoReq.
A flag indicating that the General Terms and Conditions has been accepted.
:return: The is_gtc_accepted of this UserInfoReq.
:rtype: bool
'''
pass
@is_gtc_accepted.setter
def is_gtc_accepted(self):
'''
Sets the is_gtc_accepted of this UserInfoReq.
A flag indicating that the General Terms and Conditions has been accepted.
:param is_gtc_accepted: The is_gtc_accepted of this UserInfoReq.
:type: bool
'''
pass
@property
def is_marketing_accepted(self):
'''
Gets the is_marketing_accepted of this UserInfoReq.
A flag indicating that receiving marketing information has been accepted.
:return: The is_marketing_accepted of this UserInfoReq.
:rtype: bool
'''
pass
@is_marketing_accepted.setter
def is_marketing_accepted(self):
'''
Sets the is_marketing_accepted of this UserInfoReq.
A flag indicating that receiving marketing information has been accepted.
:param is_marketing_accepted: The is_marketing_accepted of this UserInfoReq.
:type: bool
'''
pass
@property
def password(self):
'''
Gets the password of this UserInfoReq.
The password when creating a new user. It will be generated when not present in the request.
:return: The password of this UserInfoReq.
:rtype: str
'''
pass
@password.setter
def password(self):
'''
Sets the password of this UserInfoReq.
The password when creating a new user. It will be generated when not present in the request.
:param password: The password of this UserInfoReq.
:type: str
'''
pass
@property
def phone_number(self):
'''
Gets the phone_number of this UserInfoReq.
Phone number, not longer than 100 characters.
:return: The phone_number of this UserInfoReq.
:rtype: str
'''
pass
@phone_number.setter
def phone_number(self):
'''
Sets the phone_number of this UserInfoReq.
Phone number, not longer than 100 characters.
:param phone_number: The phone_number of this UserInfoReq.
:type: str
'''
pass
@property
def username(self):
'''
Gets the username of this UserInfoReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:return: The username of this UserInfoReq.
:rtype: str
'''
pass
@username.setter
def username(self):
'''
Sets the username of this UserInfoReq.
A username containing alphanumerical letters and -,._@+= characters. It must be at least 4 but not more than 30 character long.
:param username: The username of this UserInfoReq.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 43 | 25 | 10 | 1 | 3 | 5 | 1 | 1.14 | 1 | 4 | 0 | 0 | 24 | 10 | 24 | 24 | 315 | 58 | 120 | 58 | 77 | 137 | 72 | 40 | 47 | 5 | 1 | 2 | 30 |
2,563 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/updated_response.py
|
mbed_cloud._backends.iam.models.updated_response.UpdatedResponse
|
class UpdatedResponse(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'code': 'int',
'id': 'str',
'message': 'str',
'object': 'str',
'request_id': 'str',
'type': 'str'
}
attribute_map = {
'code': 'code',
'id': 'id',
'message': 'message',
'object': 'object',
'request_id': 'request_id',
'type': 'type'
}
def __init__(self, code=None, id=None, message=None, object=None, request_id=None, type=None):
"""
UpdatedResponse - a model defined in Swagger
"""
self._code = code
self._id = id
self._message = message
self._object = object
self._request_id = request_id
self._type = type
self.discriminator = None
@property
def code(self):
"""
Gets the code of this UpdatedResponse.
Response code.
:return: The code of this UpdatedResponse.
:rtype: int
"""
return self._code
@code.setter
def code(self, code):
"""
Sets the code of this UpdatedResponse.
Response code.
:param code: The code of this UpdatedResponse.
:type: int
"""
if code is None:
raise ValueError("Invalid value for `code`, must not be `None`")
self._code = code
@property
def id(self):
"""
Gets the id of this UpdatedResponse.
Entity ID.
:return: The id of this UpdatedResponse.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this UpdatedResponse.
Entity ID.
:param id: The id of this UpdatedResponse.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def message(self):
"""
Gets the message of this UpdatedResponse.
A human readable message with detailed info.
:return: The message of this UpdatedResponse.
:rtype: str
"""
return self._message
@message.setter
def message(self, message):
"""
Sets the message of this UpdatedResponse.
A human readable message with detailed info.
:param message: The message of this UpdatedResponse.
:type: str
"""
if message is None:
raise ValueError("Invalid value for `message`, must not be `None`")
self._message = message
@property
def object(self):
"""
Gets the object of this UpdatedResponse.
Entity name: 'user', 'apikey', 'group', 'policy' or 'account'.
:return: The object of this UpdatedResponse.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this UpdatedResponse.
Entity name: 'user', 'apikey', 'group', 'policy' or 'account'.
:param object: The object of this UpdatedResponse.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["user", "api-key", "group", "account", "account-template", "trusted-cert", "list", "error", "policy", "identity-provider", "user-session", "user_invitation"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def request_id(self):
"""
Gets the request_id of this UpdatedResponse.
Request ID.
:return: The request_id of this UpdatedResponse.
:rtype: str
"""
return self._request_id
@request_id.setter
def request_id(self, request_id):
"""
Sets the request_id of this UpdatedResponse.
Request ID.
:param request_id: The request_id of this UpdatedResponse.
:type: str
"""
if request_id is None:
raise ValueError("Invalid value for `request_id`, must not be `None`")
self._request_id = request_id
@property
def type(self):
"""
Gets the type of this UpdatedResponse.
Response type: success.
:return: The type of this UpdatedResponse.
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""
Sets the type of this UpdatedResponse.
Response type: success.
:param type: The type of this UpdatedResponse.
:type: str
"""
if type is None:
raise ValueError("Invalid value for `type`, must not be `None`")
allowed_values = ["success"]
if type not in allowed_values:
raise ValueError(
"Invalid value for `type` ({0}), must be one of {1}"
.format(type, allowed_values)
)
self._type = type
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, UpdatedResponse):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class UpdatedResponse(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, code=None, id=None, message=None, object=None, request_id=None, type=None):
'''
UpdatedResponse - a model defined in Swagger
'''
pass
@property
def code(self):
'''
Gets the code of this UpdatedResponse.
Response code.
:return: The code of this UpdatedResponse.
:rtype: int
'''
pass
@code.setter
def code(self):
'''
Sets the code of this UpdatedResponse.
Response code.
:param code: The code of this UpdatedResponse.
:type: int
'''
pass
@property
def id(self):
'''
Gets the id of this UpdatedResponse.
Entity ID.
:return: The id of this UpdatedResponse.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this UpdatedResponse.
Entity ID.
:param id: The id of this UpdatedResponse.
:type: str
'''
pass
@property
def message(self):
'''
Gets the message of this UpdatedResponse.
A human readable message with detailed info.
:return: The message of this UpdatedResponse.
:rtype: str
'''
pass
@message.setter
def message(self):
'''
Sets the message of this UpdatedResponse.
A human readable message with detailed info.
:param message: The message of this UpdatedResponse.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this UpdatedResponse.
Entity name: 'user', 'apikey', 'group', 'policy' or 'account'.
:return: The object of this UpdatedResponse.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this UpdatedResponse.
Entity name: 'user', 'apikey', 'group', 'policy' or 'account'.
:param object: The object of this UpdatedResponse.
:type: str
'''
pass
@property
def request_id(self):
'''
Gets the request_id of this UpdatedResponse.
Request ID.
:return: The request_id of this UpdatedResponse.
:rtype: str
'''
pass
@request_id.setter
def request_id(self):
'''
Sets the request_id of this UpdatedResponse.
Request ID.
:param request_id: The request_id of this UpdatedResponse.
:type: str
'''
pass
@property
def type(self):
'''
Gets the type of this UpdatedResponse.
Response type: success.
:return: The type of this UpdatedResponse.
:rtype: str
'''
pass
@type.setter
def type(self):
'''
Sets the type of this UpdatedResponse.
Response type: success.
:param type: The type of this UpdatedResponse.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 31 | 19 | 11 | 1 | 5 | 5 | 2 | 0.88 | 1 | 4 | 0 | 0 | 18 | 7 | 18 | 18 | 259 | 43 | 115 | 45 | 84 | 101 | 73 | 33 | 54 | 5 | 1 | 2 | 31 |
2,564 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/trusted_certificate_update_req.py
|
mbed_cloud._backends.iam.models.trusted_certificate_update_req.TrustedCertificateUpdateReq
|
class TrustedCertificateUpdateReq(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'certificate': 'str',
'description': 'str',
'enrollment_mode': 'bool',
'name': 'str',
'service': 'str',
'signature': 'str',
'status': 'str'
}
attribute_map = {
'certificate': 'certificate',
'description': 'description',
'enrollment_mode': 'enrollment_mode',
'name': 'name',
'service': 'service',
'signature': 'signature',
'status': 'status'
}
def __init__(self, certificate=None, description=None, enrollment_mode=None, name=None, service=None, signature=None, status=None):
"""
TrustedCertificateUpdateReq - a model defined in Swagger
"""
self._certificate = certificate
self._description = description
self._enrollment_mode = enrollment_mode
self._name = name
self._service = service
self._signature = signature
self._status = status
self.discriminator = None
@property
def certificate(self):
"""
Gets the certificate of this TrustedCertificateUpdateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:return: The certificate of this TrustedCertificateUpdateReq.
:rtype: str
"""
return self._certificate
@certificate.setter
def certificate(self, certificate):
"""
Sets the certificate of this TrustedCertificateUpdateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:param certificate: The certificate of this TrustedCertificateUpdateReq.
:type: str
"""
self._certificate = certificate
@property
def description(self):
"""
Gets the description of this TrustedCertificateUpdateReq.
Human readable description of this certificate, not longer than 500 characters.
:return: The description of this TrustedCertificateUpdateReq.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this TrustedCertificateUpdateReq.
Human readable description of this certificate, not longer than 500 characters.
:param description: The description of this TrustedCertificateUpdateReq.
:type: str
"""
self._description = description
@property
def enrollment_mode(self):
"""
Gets the enrollment_mode of this TrustedCertificateUpdateReq.
Certificate is used in enrollment mode. Default value is false.
:return: The enrollment_mode of this TrustedCertificateUpdateReq.
:rtype: bool
"""
return self._enrollment_mode
@enrollment_mode.setter
def enrollment_mode(self, enrollment_mode):
"""
Sets the enrollment_mode of this TrustedCertificateUpdateReq.
Certificate is used in enrollment mode. Default value is false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateUpdateReq.
:type: bool
"""
self._enrollment_mode = enrollment_mode
@property
def name(self):
"""
Gets the name of this TrustedCertificateUpdateReq.
Certificate name, not longer than 100 characters.
:return: The name of this TrustedCertificateUpdateReq.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this TrustedCertificateUpdateReq.
Certificate name, not longer than 100 characters.
:param name: The name of this TrustedCertificateUpdateReq.
:type: str
"""
self._name = name
@property
def service(self):
"""
Gets the service of this TrustedCertificateUpdateReq.
Service name where the certificate must be used.
:return: The service of this TrustedCertificateUpdateReq.
:rtype: str
"""
return self._service
@service.setter
def service(self, service):
"""
Sets the service of this TrustedCertificateUpdateReq.
Service name where the certificate must be used.
:param service: The service of this TrustedCertificateUpdateReq.
:type: str
"""
allowed_values = ["lwm2m", "bootstrap"]
if service not in allowed_values:
raise ValueError(
"Invalid value for `service` ({0}), must be one of {1}"
.format(service, allowed_values)
)
self._service = service
@property
def signature(self):
"""
Gets the signature of this TrustedCertificateUpdateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:return: The signature of this TrustedCertificateUpdateReq.
:rtype: str
"""
return self._signature
@signature.setter
def signature(self, signature):
"""
Sets the signature of this TrustedCertificateUpdateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:param signature: The signature of this TrustedCertificateUpdateReq.
:type: str
"""
self._signature = signature
@property
def status(self):
"""
Gets the status of this TrustedCertificateUpdateReq.
Status of the certificate.
:return: The status of this TrustedCertificateUpdateReq.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this TrustedCertificateUpdateReq.
Status of the certificate.
:param status: The status of this TrustedCertificateUpdateReq.
:type: str
"""
allowed_values = ["ACTIVE", "INACTIVE"]
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}"
.format(status, allowed_values)
)
self._status = status
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, TrustedCertificateUpdateReq):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class TrustedCertificateUpdateReq(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, certificate=None, description=None, enrollment_mode=None, name=None, service=None, signature=None, status=None):
'''
TrustedCertificateUpdateReq - a model defined in Swagger
'''
pass
@property
def certificate(self):
'''
Gets the certificate of this TrustedCertificateUpdateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:return: The certificate of this TrustedCertificateUpdateReq.
:rtype: str
'''
pass
@certificate.setter
def certificate(self):
'''
Sets the certificate of this TrustedCertificateUpdateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:param certificate: The certificate of this TrustedCertificateUpdateReq.
:type: str
'''
pass
@property
def description(self):
'''
Gets the description of this TrustedCertificateUpdateReq.
Human readable description of this certificate, not longer than 500 characters.
:return: The description of this TrustedCertificateUpdateReq.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this TrustedCertificateUpdateReq.
Human readable description of this certificate, not longer than 500 characters.
:param description: The description of this TrustedCertificateUpdateReq.
:type: str
'''
pass
@property
def enrollment_mode(self):
'''
Gets the enrollment_mode of this TrustedCertificateUpdateReq.
Certificate is used in enrollment mode. Default value is false.
:return: The enrollment_mode of this TrustedCertificateUpdateReq.
:rtype: bool
'''
pass
@enrollment_mode.setter
def enrollment_mode(self):
'''
Sets the enrollment_mode of this TrustedCertificateUpdateReq.
Certificate is used in enrollment mode. Default value is false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateUpdateReq.
:type: bool
'''
pass
@property
def name(self):
'''
Gets the name of this TrustedCertificateUpdateReq.
Certificate name, not longer than 100 characters.
:return: The name of this TrustedCertificateUpdateReq.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this TrustedCertificateUpdateReq.
Certificate name, not longer than 100 characters.
:param name: The name of this TrustedCertificateUpdateReq.
:type: str
'''
pass
@property
def service(self):
'''
Gets the service of this TrustedCertificateUpdateReq.
Service name where the certificate must be used.
:return: The service of this TrustedCertificateUpdateReq.
:rtype: str
'''
pass
@service.setter
def service(self):
'''
Sets the service of this TrustedCertificateUpdateReq.
Service name where the certificate must be used.
:param service: The service of this TrustedCertificateUpdateReq.
:type: str
'''
pass
@property
def signature(self):
'''
Gets the signature of this TrustedCertificateUpdateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:return: The signature of this TrustedCertificateUpdateReq.
:rtype: str
'''
pass
@signature.setter
def signature(self):
'''
Sets the signature of this TrustedCertificateUpdateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:param signature: The signature of this TrustedCertificateUpdateReq.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this TrustedCertificateUpdateReq.
Status of the certificate.
:return: The status of this TrustedCertificateUpdateReq.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this TrustedCertificateUpdateReq.
Status of the certificate.
:param status: The status of this TrustedCertificateUpdateReq.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 10 | 1 | 4 | 5 | 1 | 1.01 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 273 | 48 | 112 | 50 | 77 | 113 | 66 | 36 | 45 | 5 | 1 | 2 | 27 |
2,565 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/apis/notifications_api.py
|
mbed_cloud._backends.mds.apis.notifications_api.NotificationsApi
|
class NotificationsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def delete_long_poll_channel(self, **kwargs): # noqa: E501
"""Delete notification Long Poll channel # noqa: E501
To delete a notification Long Poll channel. This is required to change the channel from Long Poll to a callback. You should not make a GET `/v2/notification/pull` call for 2 minutes after channel was deleted, because it can implicitly recreate the pull channel. You can also have some random responses with payload or 410 GONE with \"CHANNEL_DELETED\" as a payload or 200/204 until the old channel is purged. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_long_poll_channel(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.delete_long_poll_channel_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.delete_long_poll_channel_with_http_info(**kwargs) # noqa: E501
return data
def delete_long_poll_channel_with_http_info(self, **kwargs): # noqa: E501
"""Delete notification Long Poll channel # noqa: E501
To delete a notification Long Poll channel. This is required to change the channel from Long Poll to a callback. You should not make a GET `/v2/notification/pull` call for 2 minutes after channel was deleted, because it can implicitly recreate the pull channel. You can also have some random responses with payload or 410 GONE with \"CHANNEL_DELETED\" as a payload or 200/204 until the old channel is purged. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_long_poll_channel_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_long_poll_channel" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/notification/pull', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def deregister_webhook(self, **kwargs): # noqa: E501
"""Delete callback URL # noqa: E501
Deletes the callback URL. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.deregister_webhook(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.deregister_webhook_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.deregister_webhook_with_http_info(**kwargs) # noqa: E501
return data
def deregister_webhook_with_http_info(self, **kwargs): # noqa: E501
"""Delete callback URL # noqa: E501
Deletes the callback URL. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.deregister_webhook_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method deregister_webhook" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/notification/callback', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_webhook(self, **kwargs): # noqa: E501
"""Check callback URL # noqa: E501
Shows the current callback URL if it exists. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_webhook(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: Webhook
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_webhook_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_webhook_with_http_info(**kwargs) # noqa: E501
return data
def get_webhook_with_http_info(self, **kwargs): # noqa: E501
"""Check callback URL # noqa: E501
Shows the current callback URL if it exists. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_webhook_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: Webhook
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_webhook" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/notification/callback', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='Webhook', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def long_poll_notifications(self, **kwargs): # noqa: E501
"""Get notifications using Long Poll # noqa: E501
In this case, notifications are delivered through HTTP long poll requests. The HTTP request is kept open until an event notification or a batch of event notifications are delivered to the client or the request times out (response code 204). In both cases, the client should open a new polling connection after the previous one closes. Only a single long polling connection per API key can be ongoing at any given time. You must have a persistent connection (Connection keep-alive header in the request) to avoid excess TLS handshakes. The pull channel is implicitly created by the first GET call to `/v2/notification/pull`. It is refreshed on each GET call. If the channel is not polled for a long time (10 minutes) - it expires and will be deleted. This means that no notifications will stay in the queue between polls. A channel can be also deleted explicitly by a DELETE call. **Note:** If you cannot have a public facing callback URL, for example when developing on your local machine, you can use long polling to check for new messages. However, **long polling is deprecated** and will likely be replaced in future. It is meant only for experimentation and not for commercial usage. The proper method to receive notifications is a **notification callback**. There can only be one notification channel per API key at a time in Device Management Connect. If a callback notification channel already exists, you need to delete it before creating a long poll notification channel, and vice-versa. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.long_poll_notifications(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: NotificationMessage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.long_poll_notifications_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.long_poll_notifications_with_http_info(**kwargs) # noqa: E501
return data
def long_poll_notifications_with_http_info(self, **kwargs): # noqa: E501
"""Get notifications using Long Poll # noqa: E501
In this case, notifications are delivered through HTTP long poll requests. The HTTP request is kept open until an event notification or a batch of event notifications are delivered to the client or the request times out (response code 204). In both cases, the client should open a new polling connection after the previous one closes. Only a single long polling connection per API key can be ongoing at any given time. You must have a persistent connection (Connection keep-alive header in the request) to avoid excess TLS handshakes. The pull channel is implicitly created by the first GET call to `/v2/notification/pull`. It is refreshed on each GET call. If the channel is not polled for a long time (10 minutes) - it expires and will be deleted. This means that no notifications will stay in the queue between polls. A channel can be also deleted explicitly by a DELETE call. **Note:** If you cannot have a public facing callback URL, for example when developing on your local machine, you can use long polling to check for new messages. However, **long polling is deprecated** and will likely be replaced in future. It is meant only for experimentation and not for commercial usage. The proper method to receive notifications is a **notification callback**. There can only be one notification channel per API key at a time in Device Management Connect. If a callback notification channel already exists, you need to delete it before creating a long poll notification channel, and vice-versa. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.long_poll_notifications_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: NotificationMessage
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method long_poll_notifications" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/notification/pull', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='NotificationMessage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def register_webhook(self, webhook, **kwargs): # noqa: E501
"""Register a callback URL # noqa: E501
Register a URL to which the server should deliver notifications of the subscribed resource changes. To get notifications pushed, you also need to place the subscriptions. The maximum length of the URL, header keys and values, all combined, is 400 characters. Notifications are delivered as PUT messages to the HTTP server defined by the client with a subscription server message. The given URL should be accessible and respond to the PUT request with response code of 200 or 204. Device Management Connect tests the callback URL with an empty payload when the URL is registered. For more information on callback notification, see [NotificationMessage](/docs/current/service-api-references/mbed-cloud-connect.html#models). **Optional headers in a callback message:** You can set optional headers to a callback in a **Webhook** object. Device Management Connect will include the header and key pairs to the notification messages send them to callback URL. As the callback URL's are API key specific also the headers are. One possible use for the additional headers is to check the origin of a PUT request and also distinguish the application (API key) to which the notification belongs to. **Note**: Only one callback URL per an API key can be active. If you register a new URL while another one is already active, it replaces the active one. There can be only one notification channel at a time. If the Long Poll notification is already present, you need to delete it before setting the callback URL. **Expiration of a callback URL:** A callback can expire when Device Management cannot deliver a notification due to a connection timeout or an error response (4xx or 5xx). After each delivery failure, Device Management sets an exponential back off time and makes a retry attempt after that. The first retry delay is 1 second, then 2s, 4s, 8s, ..., 2min, 2min. The maximum retry delay is 2 minutes. The callback URL will be removed if all retries fail withing 24 hours. More about [notification sending logic](/docs/current/integrate-web-app/event-notification.html#notification-sending-logic). **Supported callback URL protocols:** Currently, only HTTP and HTTPS protocols are supported. **HTTPS callback URLs:** When delivering a notification to an HTTPS based callback URL, Device Management Connect will present a valid client certificate to identify itself. The certificate is signed by a trusted certificate authorithy (GlobalSign) with a Common Name (CN) set to notifications.mbedcloud.com. **Example usage:** This example command shows how to set your callback URL and API key. It also sets an optional header authorization. When Device Management Connect calls your callback URL, the call contains the authorization header with the defined value. curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/notification/callback \\ -H 'authorization: Bearer {api-key}' \\ -H 'content-type: application/json' \\ -d '{ \"url\": \"{callback-url}\", \"headers\": {\"authorization\" : \"f4b93d6e-4652-4874-82e4-41a3ced0cd56\"} }' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.register_webhook(webhook, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param Webhook webhook: A json object that contains the optional headers and the URL to which the notifications need to be sent. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.register_webhook_with_http_info(webhook, **kwargs) # noqa: E501
else:
(data) = self.register_webhook_with_http_info(webhook, **kwargs) # noqa: E501
return data
def register_webhook_with_http_info(self, webhook, **kwargs): # noqa: E501
"""Register a callback URL # noqa: E501
Register a URL to which the server should deliver notifications of the subscribed resource changes. To get notifications pushed, you also need to place the subscriptions. The maximum length of the URL, header keys and values, all combined, is 400 characters. Notifications are delivered as PUT messages to the HTTP server defined by the client with a subscription server message. The given URL should be accessible and respond to the PUT request with response code of 200 or 204. Device Management Connect tests the callback URL with an empty payload when the URL is registered. For more information on callback notification, see [NotificationMessage](/docs/current/service-api-references/mbed-cloud-connect.html#models). **Optional headers in a callback message:** You can set optional headers to a callback in a **Webhook** object. Device Management Connect will include the header and key pairs to the notification messages send them to callback URL. As the callback URL's are API key specific also the headers are. One possible use for the additional headers is to check the origin of a PUT request and also distinguish the application (API key) to which the notification belongs to. **Note**: Only one callback URL per an API key can be active. If you register a new URL while another one is already active, it replaces the active one. There can be only one notification channel at a time. If the Long Poll notification is already present, you need to delete it before setting the callback URL. **Expiration of a callback URL:** A callback can expire when Device Management cannot deliver a notification due to a connection timeout or an error response (4xx or 5xx). After each delivery failure, Device Management sets an exponential back off time and makes a retry attempt after that. The first retry delay is 1 second, then 2s, 4s, 8s, ..., 2min, 2min. The maximum retry delay is 2 minutes. The callback URL will be removed if all retries fail withing 24 hours. More about [notification sending logic](/docs/current/integrate-web-app/event-notification.html#notification-sending-logic). **Supported callback URL protocols:** Currently, only HTTP and HTTPS protocols are supported. **HTTPS callback URLs:** When delivering a notification to an HTTPS based callback URL, Device Management Connect will present a valid client certificate to identify itself. The certificate is signed by a trusted certificate authorithy (GlobalSign) with a Common Name (CN) set to notifications.mbedcloud.com. **Example usage:** This example command shows how to set your callback URL and API key. It also sets an optional header authorization. When Device Management Connect calls your callback URL, the call contains the authorization header with the defined value. curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/notification/callback \\ -H 'authorization: Bearer {api-key}' \\ -H 'content-type: application/json' \\ -d '{ \"url\": \"{callback-url}\", \"headers\": {\"authorization\" : \"f4b93d6e-4652-4874-82e4-41a3ced0cd56\"} }' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.register_webhook_with_http_info(webhook, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param Webhook webhook: A json object that contains the optional headers and the URL to which the notifications need to be sent. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['webhook'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method register_webhook" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'webhook' is set
if ('webhook' not in params or
params['webhook'] is None):
raise ValueError("Missing the required parameter `webhook` when calling `register_webhook`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'webhook' in params:
body_params = params['webhook']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/notification/callback', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class NotificationsApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def delete_long_poll_channel(self, **kwargs):
'''Delete notification Long Poll channel # noqa: E501
To delete a notification Long Poll channel. This is required to change the channel from Long Poll to a callback. You should not make a GET `/v2/notification/pull` call for 2 minutes after channel was deleted, because it can implicitly recreate the pull channel. You can also have some random responses with payload or 410 GONE with "CHANNEL_DELETED" as a payload or 200/204 until the old channel is purged. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_long_poll_channel(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_long_poll_channel_with_http_info(self, **kwargs):
'''Delete notification Long Poll channel # noqa: E501
To delete a notification Long Poll channel. This is required to change the channel from Long Poll to a callback. You should not make a GET `/v2/notification/pull` call for 2 minutes after channel was deleted, because it can implicitly recreate the pull channel. You can also have some random responses with payload or 410 GONE with "CHANNEL_DELETED" as a payload or 200/204 until the old channel is purged. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_long_poll_channel_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def deregister_webhook(self, **kwargs):
'''Delete callback URL # noqa: E501
Deletes the callback URL. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.deregister_webhook(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def deregister_webhook_with_http_info(self, **kwargs):
'''Delete callback URL # noqa: E501
Deletes the callback URL. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.deregister_webhook_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_webhook(self, **kwargs):
'''Check callback URL # noqa: E501
Shows the current callback URL if it exists. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_webhook(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: Webhook
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_webhook_with_http_info(self, **kwargs):
'''Check callback URL # noqa: E501
Shows the current callback URL if it exists. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/callback -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_webhook_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: Webhook
If the method is called asynchronously,
returns the request thread.
'''
pass
def long_poll_notifications(self, **kwargs):
'''Get notifications using Long Poll # noqa: E501
In this case, notifications are delivered through HTTP long poll requests. The HTTP request is kept open until an event notification or a batch of event notifications are delivered to the client or the request times out (response code 204). In both cases, the client should open a new polling connection after the previous one closes. Only a single long polling connection per API key can be ongoing at any given time. You must have a persistent connection (Connection keep-alive header in the request) to avoid excess TLS handshakes. The pull channel is implicitly created by the first GET call to `/v2/notification/pull`. It is refreshed on each GET call. If the channel is not polled for a long time (10 minutes) - it expires and will be deleted. This means that no notifications will stay in the queue between polls. A channel can be also deleted explicitly by a DELETE call. **Note:** If you cannot have a public facing callback URL, for example when developing on your local machine, you can use long polling to check for new messages. However, **long polling is deprecated** and will likely be replaced in future. It is meant only for experimentation and not for commercial usage. The proper method to receive notifications is a **notification callback**. There can only be one notification channel per API key at a time in Device Management Connect. If a callback notification channel already exists, you need to delete it before creating a long poll notification channel, and vice-versa. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.long_poll_notifications(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: NotificationMessage
If the method is called asynchronously,
returns the request thread.
'''
pass
def long_poll_notifications_with_http_info(self, **kwargs):
'''Get notifications using Long Poll # noqa: E501
In this case, notifications are delivered through HTTP long poll requests. The HTTP request is kept open until an event notification or a batch of event notifications are delivered to the client or the request times out (response code 204). In both cases, the client should open a new polling connection after the previous one closes. Only a single long polling connection per API key can be ongoing at any given time. You must have a persistent connection (Connection keep-alive header in the request) to avoid excess TLS handshakes. The pull channel is implicitly created by the first GET call to `/v2/notification/pull`. It is refreshed on each GET call. If the channel is not polled for a long time (10 minutes) - it expires and will be deleted. This means that no notifications will stay in the queue between polls. A channel can be also deleted explicitly by a DELETE call. **Note:** If you cannot have a public facing callback URL, for example when developing on your local machine, you can use long polling to check for new messages. However, **long polling is deprecated** and will likely be replaced in future. It is meant only for experimentation and not for commercial usage. The proper method to receive notifications is a **notification callback**. There can only be one notification channel per API key at a time in Device Management Connect. If a callback notification channel already exists, you need to delete it before creating a long poll notification channel, and vice-versa. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/notification/pull -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.long_poll_notifications_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: NotificationMessage
If the method is called asynchronously,
returns the request thread.
'''
pass
def register_webhook(self, webhook, **kwargs):
'''Register a callback URL # noqa: E501
Register a URL to which the server should deliver notifications of the subscribed resource changes. To get notifications pushed, you also need to place the subscriptions. The maximum length of the URL, header keys and values, all combined, is 400 characters. Notifications are delivered as PUT messages to the HTTP server defined by the client with a subscription server message. The given URL should be accessible and respond to the PUT request with response code of 200 or 204. Device Management Connect tests the callback URL with an empty payload when the URL is registered. For more information on callback notification, see [NotificationMessage](/docs/current/service-api-references/mbed-cloud-connect.html#models). **Optional headers in a callback message:** You can set optional headers to a callback in a **Webhook** object. Device Management Connect will include the header and key pairs to the notification messages send them to callback URL. As the callback URL's are API key specific also the headers are. One possible use for the additional headers is to check the origin of a PUT request and also distinguish the application (API key) to which the notification belongs to. **Note**: Only one callback URL per an API key can be active. If you register a new URL while another one is already active, it replaces the active one. There can be only one notification channel at a time. If the Long Poll notification is already present, you need to delete it before setting the callback URL. **Expiration of a callback URL:** A callback can expire when Device Management cannot deliver a notification due to a connection timeout or an error response (4xx or 5xx). After each delivery failure, Device Management sets an exponential back off time and makes a retry attempt after that. The first retry delay is 1 second, then 2s, 4s, 8s, ..., 2min, 2min. The maximum retry delay is 2 minutes. The callback URL will be removed if all retries fail withing 24 hours. More about [notification sending logic](/docs/current/integrate-web-app/event-notification.html#notification-sending-logic). **Supported callback URL protocols:** Currently, only HTTP and HTTPS protocols are supported. **HTTPS callback URLs:** When delivering a notification to an HTTPS based callback URL, Device Management Connect will present a valid client certificate to identify itself. The certificate is signed by a trusted certificate authorithy (GlobalSign) with a Common Name (CN) set to notifications.mbedcloud.com. **Example usage:** This example command shows how to set your callback URL and API key. It also sets an optional header authorization. When Device Management Connect calls your callback URL, the call contains the authorization header with the defined value. curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/notification/callback \ -H 'authorization: Bearer {api-key}' \ -H 'content-type: application/json' \ -d '{ "url": "{callback-url}", "headers": {"authorization" : "f4b93d6e-4652-4874-82e4-41a3ced0cd56"} }' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.register_webhook(webhook, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param Webhook webhook: A json object that contains the optional headers and the URL to which the notifications need to be sent. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def register_webhook_with_http_info(self, webhook, **kwargs):
'''Register a callback URL # noqa: E501
Register a URL to which the server should deliver notifications of the subscribed resource changes. To get notifications pushed, you also need to place the subscriptions. The maximum length of the URL, header keys and values, all combined, is 400 characters. Notifications are delivered as PUT messages to the HTTP server defined by the client with a subscription server message. The given URL should be accessible and respond to the PUT request with response code of 200 or 204. Device Management Connect tests the callback URL with an empty payload when the URL is registered. For more information on callback notification, see [NotificationMessage](/docs/current/service-api-references/mbed-cloud-connect.html#models). **Optional headers in a callback message:** You can set optional headers to a callback in a **Webhook** object. Device Management Connect will include the header and key pairs to the notification messages send them to callback URL. As the callback URL's are API key specific also the headers are. One possible use for the additional headers is to check the origin of a PUT request and also distinguish the application (API key) to which the notification belongs to. **Note**: Only one callback URL per an API key can be active. If you register a new URL while another one is already active, it replaces the active one. There can be only one notification channel at a time. If the Long Poll notification is already present, you need to delete it before setting the callback URL. **Expiration of a callback URL:** A callback can expire when Device Management cannot deliver a notification due to a connection timeout or an error response (4xx or 5xx). After each delivery failure, Device Management sets an exponential back off time and makes a retry attempt after that. The first retry delay is 1 second, then 2s, 4s, 8s, ..., 2min, 2min. The maximum retry delay is 2 minutes. The callback URL will be removed if all retries fail withing 24 hours. More about [notification sending logic](/docs/current/integrate-web-app/event-notification.html#notification-sending-logic). **Supported callback URL protocols:** Currently, only HTTP and HTTPS protocols are supported. **HTTPS callback URLs:** When delivering a notification to an HTTPS based callback URL, Device Management Connect will present a valid client certificate to identify itself. The certificate is signed by a trusted certificate authorithy (GlobalSign) with a Common Name (CN) set to notifications.mbedcloud.com. **Example usage:** This example command shows how to set your callback URL and API key. It also sets an optional header authorization. When Device Management Connect calls your callback URL, the call contains the authorization header with the defined value. curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/notification/callback \ -H 'authorization: Bearer {api-key}' \ -H 'content-type: application/json' \ -d '{ "url": "{callback-url}", "headers": {"authorization" : "f4b93d6e-4652-4874-82e4-41a3ced0cd56"} }' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.register_webhook_with_http_info(webhook, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param Webhook webhook: A json object that contains the optional headers and the URL to which the notifications need to be sent. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
| 12 | 11 | 39 | 6 | 22 | 15 | 3 | 0.68 | 1 | 3 | 1 | 0 | 11 | 1 | 11 | 11 | 446 | 80 | 241 | 73 | 229 | 165 | 147 | 73 | 135 | 5 | 1 | 2 | 29 |
2,566 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/trusted_certificate_root_req.py
|
mbed_cloud._backends.iam.models.trusted_certificate_root_req.TrustedCertificateRootReq
|
class TrustedCertificateRootReq(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'certificate': 'str',
'description': 'str',
'enrollment_mode': 'bool',
'name': 'str',
'service': 'str',
'signature': 'str',
'status': 'str'
}
attribute_map = {
'certificate': 'certificate',
'description': 'description',
'enrollment_mode': 'enrollment_mode',
'name': 'name',
'service': 'service',
'signature': 'signature',
'status': 'status'
}
def __init__(self, certificate=None, description=None, enrollment_mode=None, name=None, service=None, signature=None, status=None):
"""
TrustedCertificateRootReq - a model defined in Swagger
"""
self._certificate = certificate
self._description = description
self._enrollment_mode = enrollment_mode
self._name = name
self._service = service
self._signature = signature
self._status = status
self.discriminator = None
@property
def certificate(self):
"""
Gets the certificate of this TrustedCertificateRootReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:return: The certificate of this TrustedCertificateRootReq.
:rtype: str
"""
return self._certificate
@certificate.setter
def certificate(self, certificate):
"""
Sets the certificate of this TrustedCertificateRootReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:param certificate: The certificate of this TrustedCertificateRootReq.
:type: str
"""
if certificate is None:
raise ValueError("Invalid value for `certificate`, must not be `None`")
self._certificate = certificate
@property
def description(self):
"""
Gets the description of this TrustedCertificateRootReq.
Human readable description of this certificate, not longer than 500 characters.
:return: The description of this TrustedCertificateRootReq.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this TrustedCertificateRootReq.
Human readable description of this certificate, not longer than 500 characters.
:param description: The description of this TrustedCertificateRootReq.
:type: str
"""
self._description = description
@property
def enrollment_mode(self):
"""
Gets the enrollment_mode of this TrustedCertificateRootReq.
Certificate is used in enrollment mode. Default value is false.
:return: The enrollment_mode of this TrustedCertificateRootReq.
:rtype: bool
"""
return self._enrollment_mode
@enrollment_mode.setter
def enrollment_mode(self, enrollment_mode):
"""
Sets the enrollment_mode of this TrustedCertificateRootReq.
Certificate is used in enrollment mode. Default value is false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateRootReq.
:type: bool
"""
self._enrollment_mode = enrollment_mode
@property
def name(self):
"""
Gets the name of this TrustedCertificateRootReq.
Certificate name, not longer than 100 characters.
:return: The name of this TrustedCertificateRootReq.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this TrustedCertificateRootReq.
Certificate name, not longer than 100 characters.
:param name: The name of this TrustedCertificateRootReq.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name
@property
def service(self):
"""
Gets the service of this TrustedCertificateRootReq.
Service name where the certificate must be used.
:return: The service of this TrustedCertificateRootReq.
:rtype: str
"""
return self._service
@service.setter
def service(self, service):
"""
Sets the service of this TrustedCertificateRootReq.
Service name where the certificate must be used.
:param service: The service of this TrustedCertificateRootReq.
:type: str
"""
if service is None:
raise ValueError("Invalid value for `service`, must not be `None`")
allowed_values = ["lwm2m", "bootstrap"]
if service not in allowed_values:
raise ValueError(
"Invalid value for `service` ({0}), must be one of {1}"
.format(service, allowed_values)
)
self._service = service
@property
def signature(self):
"""
Gets the signature of this TrustedCertificateRootReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:return: The signature of this TrustedCertificateRootReq.
:rtype: str
"""
return self._signature
@signature.setter
def signature(self, signature):
"""
Sets the signature of this TrustedCertificateRootReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:param signature: The signature of this TrustedCertificateRootReq.
:type: str
"""
self._signature = signature
@property
def status(self):
"""
Gets the status of this TrustedCertificateRootReq.
Status of the certificate.
:return: The status of this TrustedCertificateRootReq.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this TrustedCertificateRootReq.
Status of the certificate.
:param status: The status of this TrustedCertificateRootReq.
:type: str
"""
allowed_values = ["ACTIVE", "INACTIVE"]
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}"
.format(status, allowed_values)
)
self._status = status
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, TrustedCertificateRootReq):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class TrustedCertificateRootReq(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, certificate=None, description=None, enrollment_mode=None, name=None, service=None, signature=None, status=None):
'''
TrustedCertificateRootReq - a model defined in Swagger
'''
pass
@property
def certificate(self):
'''
Gets the certificate of this TrustedCertificateRootReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:return: The certificate of this TrustedCertificateRootReq.
:rtype: str
'''
pass
@certificate.setter
def certificate(self):
'''
Sets the certificate of this TrustedCertificateRootReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:param certificate: The certificate of this TrustedCertificateRootReq.
:type: str
'''
pass
@property
def description(self):
'''
Gets the description of this TrustedCertificateRootReq.
Human readable description of this certificate, not longer than 500 characters.
:return: The description of this TrustedCertificateRootReq.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this TrustedCertificateRootReq.
Human readable description of this certificate, not longer than 500 characters.
:param description: The description of this TrustedCertificateRootReq.
:type: str
'''
pass
@property
def enrollment_mode(self):
'''
Gets the enrollment_mode of this TrustedCertificateRootReq.
Certificate is used in enrollment mode. Default value is false.
:return: The enrollment_mode of this TrustedCertificateRootReq.
:rtype: bool
'''
pass
@enrollment_mode.setter
def enrollment_mode(self):
'''
Sets the enrollment_mode of this TrustedCertificateRootReq.
Certificate is used in enrollment mode. Default value is false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateRootReq.
:type: bool
'''
pass
@property
def name(self):
'''
Gets the name of this TrustedCertificateRootReq.
Certificate name, not longer than 100 characters.
:return: The name of this TrustedCertificateRootReq.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this TrustedCertificateRootReq.
Certificate name, not longer than 100 characters.
:param name: The name of this TrustedCertificateRootReq.
:type: str
'''
pass
@property
def service(self):
'''
Gets the service of this TrustedCertificateRootReq.
Service name where the certificate must be used.
:return: The service of this TrustedCertificateRootReq.
:rtype: str
'''
pass
@service.setter
def service(self):
'''
Sets the service of this TrustedCertificateRootReq.
Service name where the certificate must be used.
:param service: The service of this TrustedCertificateRootReq.
:type: str
'''
pass
@property
def signature(self):
'''
Gets the signature of this TrustedCertificateRootReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:return: The signature of this TrustedCertificateRootReq.
:rtype: str
'''
pass
@signature.setter
def signature(self):
'''
Sets the signature of this TrustedCertificateRootReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:param signature: The signature of this TrustedCertificateRootReq.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this TrustedCertificateRootReq.
Status of the certificate.
:return: The status of this TrustedCertificateRootReq.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this TrustedCertificateRootReq.
Status of the certificate.
:param status: The status of this TrustedCertificateRootReq.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 11 | 1 | 4 | 5 | 2 | 0.96 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 279 | 48 | 118 | 50 | 83 | 113 | 72 | 36 | 51 | 5 | 1 | 2 | 30 |
2,567 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/trusted_certificate_resp.py
|
mbed_cloud._backends.iam.models.trusted_certificate_resp.TrustedCertificateResp
|
class TrustedCertificateResp(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account_id': 'str',
'certificate': 'str',
'created_at': 'datetime',
'description': 'str',
'device_execution_mode': 'int',
'enrollment_mode': 'bool',
'etag': 'str',
'id': 'str',
'issuer': 'str',
'name': 'str',
'object': 'str',
'owner_id': 'str',
'service': 'str',
'status': 'str',
'subject': 'str',
'updated_at': 'datetime',
'validity': 'datetime'
}
attribute_map = {
'account_id': 'account_id',
'certificate': 'certificate',
'created_at': 'created_at',
'description': 'description',
'device_execution_mode': 'device_execution_mode',
'enrollment_mode': 'enrollment_mode',
'etag': 'etag',
'id': 'id',
'issuer': 'issuer',
'name': 'name',
'object': 'object',
'owner_id': 'owner_id',
'service': 'service',
'status': 'status',
'subject': 'subject',
'updated_at': 'updated_at',
'validity': 'validity'
}
def __init__(self, account_id=None, certificate=None, created_at=None, description=None, device_execution_mode=None, enrollment_mode=None, etag=None, id=None, issuer=None, name=None, object=None, owner_id=None, service=None, status=None, subject=None, updated_at=None, validity=None):
"""
TrustedCertificateResp - a model defined in Swagger
"""
self._account_id = account_id
self._certificate = certificate
self._created_at = created_at
self._description = description
self._device_execution_mode = device_execution_mode
self._enrollment_mode = enrollment_mode
self._etag = etag
self._id = id
self._issuer = issuer
self._name = name
self._object = object
self._owner_id = owner_id
self._service = service
self._status = status
self._subject = subject
self._updated_at = updated_at
self._validity = validity
self.discriminator = None
@property
def account_id(self):
"""
Gets the account_id of this TrustedCertificateResp.
The UUID of the account.
:return: The account_id of this TrustedCertificateResp.
:rtype: str
"""
return self._account_id
@account_id.setter
def account_id(self, account_id):
"""
Sets the account_id of this TrustedCertificateResp.
The UUID of the account.
:param account_id: The account_id of this TrustedCertificateResp.
:type: str
"""
if account_id is None:
raise ValueError("Invalid value for `account_id`, must not be `None`")
self._account_id = account_id
@property
def certificate(self):
"""
Gets the certificate of this TrustedCertificateResp.
X509.v3 trusted certificate in PEM format.
:return: The certificate of this TrustedCertificateResp.
:rtype: str
"""
return self._certificate
@certificate.setter
def certificate(self, certificate):
"""
Sets the certificate of this TrustedCertificateResp.
X509.v3 trusted certificate in PEM format.
:param certificate: The certificate of this TrustedCertificateResp.
:type: str
"""
if certificate is None:
raise ValueError("Invalid value for `certificate`, must not be `None`")
self._certificate = certificate
@property
def created_at(self):
"""
Gets the created_at of this TrustedCertificateResp.
Creation UTC time RFC3339.
:return: The created_at of this TrustedCertificateResp.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this TrustedCertificateResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this TrustedCertificateResp.
:type: datetime
"""
self._created_at = created_at
@property
def description(self):
"""
Gets the description of this TrustedCertificateResp.
Human readable description of this certificate.
:return: The description of this TrustedCertificateResp.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this TrustedCertificateResp.
Human readable description of this certificate.
:param description: The description of this TrustedCertificateResp.
:type: str
"""
self._description = description
@property
def device_execution_mode(self):
"""
Gets the device_execution_mode of this TrustedCertificateResp.
Device execution mode where 1 means a developer certificate.
:return: The device_execution_mode of this TrustedCertificateResp.
:rtype: int
"""
return self._device_execution_mode
@device_execution_mode.setter
def device_execution_mode(self, device_execution_mode):
"""
Sets the device_execution_mode of this TrustedCertificateResp.
Device execution mode where 1 means a developer certificate.
:param device_execution_mode: The device_execution_mode of this TrustedCertificateResp.
:type: int
"""
self._device_execution_mode = device_execution_mode
@property
def enrollment_mode(self):
"""
Gets the enrollment_mode of this TrustedCertificateResp.
If true, signature is not required. Default value false.
:return: The enrollment_mode of this TrustedCertificateResp.
:rtype: bool
"""
return self._enrollment_mode
@enrollment_mode.setter
def enrollment_mode(self, enrollment_mode):
"""
Sets the enrollment_mode of this TrustedCertificateResp.
If true, signature is not required. Default value false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateResp.
:type: bool
"""
self._enrollment_mode = enrollment_mode
@property
def etag(self):
"""
Gets the etag of this TrustedCertificateResp.
API resource entity version.
:return: The etag of this TrustedCertificateResp.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this TrustedCertificateResp.
API resource entity version.
:param etag: The etag of this TrustedCertificateResp.
:type: str
"""
if etag is None:
raise ValueError("Invalid value for `etag`, must not be `None`")
self._etag = etag
@property
def id(self):
"""
Gets the id of this TrustedCertificateResp.
Entity ID.
:return: The id of this TrustedCertificateResp.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this TrustedCertificateResp.
Entity ID.
:param id: The id of this TrustedCertificateResp.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def issuer(self):
"""
Gets the issuer of this TrustedCertificateResp.
Issuer of the certificate.
:return: The issuer of this TrustedCertificateResp.
:rtype: str
"""
return self._issuer
@issuer.setter
def issuer(self, issuer):
"""
Sets the issuer of this TrustedCertificateResp.
Issuer of the certificate.
:param issuer: The issuer of this TrustedCertificateResp.
:type: str
"""
if issuer is None:
raise ValueError("Invalid value for `issuer`, must not be `None`")
self._issuer = issuer
@property
def name(self):
"""
Gets the name of this TrustedCertificateResp.
Certificate name.
:return: The name of this TrustedCertificateResp.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this TrustedCertificateResp.
Certificate name.
:param name: The name of this TrustedCertificateResp.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name
@property
def object(self):
"""
Gets the object of this TrustedCertificateResp.
Entity name: always 'trusted-cert'
:return: The object of this TrustedCertificateResp.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this TrustedCertificateResp.
Entity name: always 'trusted-cert'
:param object: The object of this TrustedCertificateResp.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["trusted-cert"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def owner_id(self):
"""
Gets the owner_id of this TrustedCertificateResp.
The UUID of the owner.
:return: The owner_id of this TrustedCertificateResp.
:rtype: str
"""
return self._owner_id
@owner_id.setter
def owner_id(self, owner_id):
"""
Sets the owner_id of this TrustedCertificateResp.
The UUID of the owner.
:param owner_id: The owner_id of this TrustedCertificateResp.
:type: str
"""
self._owner_id = owner_id
@property
def service(self):
"""
Gets the service of this TrustedCertificateResp.
Service name where the certificate is to be used.
:return: The service of this TrustedCertificateResp.
:rtype: str
"""
return self._service
@service.setter
def service(self, service):
"""
Sets the service of this TrustedCertificateResp.
Service name where the certificate is to be used.
:param service: The service of this TrustedCertificateResp.
:type: str
"""
if service is None:
raise ValueError("Invalid value for `service`, must not be `None`")
allowed_values = ["lwm2m", "bootstrap"]
if service not in allowed_values:
raise ValueError(
"Invalid value for `service` ({0}), must be one of {1}"
.format(service, allowed_values)
)
self._service = service
@property
def status(self):
"""
Gets the status of this TrustedCertificateResp.
Status of the certificate.
:return: The status of this TrustedCertificateResp.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this TrustedCertificateResp.
Status of the certificate.
:param status: The status of this TrustedCertificateResp.
:type: str
"""
allowed_values = ["ACTIVE", "INACTIVE"]
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}"
.format(status, allowed_values)
)
self._status = status
@property
def subject(self):
"""
Gets the subject of this TrustedCertificateResp.
Subject of the certificate.
:return: The subject of this TrustedCertificateResp.
:rtype: str
"""
return self._subject
@subject.setter
def subject(self, subject):
"""
Sets the subject of this TrustedCertificateResp.
Subject of the certificate.
:param subject: The subject of this TrustedCertificateResp.
:type: str
"""
if subject is None:
raise ValueError("Invalid value for `subject`, must not be `None`")
self._subject = subject
@property
def updated_at(self):
"""
Gets the updated_at of this TrustedCertificateResp.
Last update UTC time RFC3339.
:return: The updated_at of this TrustedCertificateResp.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this TrustedCertificateResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this TrustedCertificateResp.
:type: datetime
"""
self._updated_at = updated_at
@property
def validity(self):
"""
Gets the validity of this TrustedCertificateResp.
Expiration time in UTC formatted as RFC3339.
:return: The validity of this TrustedCertificateResp.
:rtype: datetime
"""
return self._validity
@validity.setter
def validity(self, validity):
"""
Sets the validity of this TrustedCertificateResp.
Expiration time in UTC formatted as RFC3339.
:param validity: The validity of this TrustedCertificateResp.
:type: datetime
"""
if validity is None:
raise ValueError("Invalid value for `validity`, must not be `None`")
self._validity = validity
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, TrustedCertificateResp):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class TrustedCertificateResp(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, account_id=None, certificate=None, created_at=None, description=None, device_execution_mode=None, enrollment_mode=None, etag=None, id=None, issuer=None, name=None, object=None, owner_id=None, service=None, status=None, subject=None, updated_at=None, validity=None):
'''
TrustedCertificateResp - a model defined in Swagger
'''
pass
@property
def account_id(self):
'''
Gets the account_id of this TrustedCertificateResp.
The UUID of the account.
:return: The account_id of this TrustedCertificateResp.
:rtype: str
'''
pass
@account_id.setter
def account_id(self):
'''
Sets the account_id of this TrustedCertificateResp.
The UUID of the account.
:param account_id: The account_id of this TrustedCertificateResp.
:type: str
'''
pass
@property
def certificate(self):
'''
Gets the certificate of this TrustedCertificateResp.
X509.v3 trusted certificate in PEM format.
:return: The certificate of this TrustedCertificateResp.
:rtype: str
'''
pass
@certificate.setter
def certificate(self):
'''
Sets the certificate of this TrustedCertificateResp.
X509.v3 trusted certificate in PEM format.
:param certificate: The certificate of this TrustedCertificateResp.
:type: str
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this TrustedCertificateResp.
Creation UTC time RFC3339.
:return: The created_at of this TrustedCertificateResp.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this TrustedCertificateResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this TrustedCertificateResp.
:type: datetime
'''
pass
@property
def description(self):
'''
Gets the description of this TrustedCertificateResp.
Human readable description of this certificate.
:return: The description of this TrustedCertificateResp.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this TrustedCertificateResp.
Human readable description of this certificate.
:param description: The description of this TrustedCertificateResp.
:type: str
'''
pass
@property
def device_execution_mode(self):
'''
Gets the device_execution_mode of this TrustedCertificateResp.
Device execution mode where 1 means a developer certificate.
:return: The device_execution_mode of this TrustedCertificateResp.
:rtype: int
'''
pass
@device_execution_mode.setter
def device_execution_mode(self):
'''
Sets the device_execution_mode of this TrustedCertificateResp.
Device execution mode where 1 means a developer certificate.
:param device_execution_mode: The device_execution_mode of this TrustedCertificateResp.
:type: int
'''
pass
@property
def enrollment_mode(self):
'''
Gets the enrollment_mode of this TrustedCertificateResp.
If true, signature is not required. Default value false.
:return: The enrollment_mode of this TrustedCertificateResp.
:rtype: bool
'''
pass
@enrollment_mode.setter
def enrollment_mode(self):
'''
Sets the enrollment_mode of this TrustedCertificateResp.
If true, signature is not required. Default value false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateResp.
:type: bool
'''
pass
@property
def etag(self):
'''
Gets the etag of this TrustedCertificateResp.
API resource entity version.
:return: The etag of this TrustedCertificateResp.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this TrustedCertificateResp.
API resource entity version.
:param etag: The etag of this TrustedCertificateResp.
:type: str
'''
pass
@property
def id(self):
'''
Gets the id of this TrustedCertificateResp.
Entity ID.
:return: The id of this TrustedCertificateResp.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this TrustedCertificateResp.
Entity ID.
:param id: The id of this TrustedCertificateResp.
:type: str
'''
pass
@property
def issuer(self):
'''
Gets the issuer of this TrustedCertificateResp.
Issuer of the certificate.
:return: The issuer of this TrustedCertificateResp.
:rtype: str
'''
pass
@issuer.setter
def issuer(self):
'''
Sets the issuer of this TrustedCertificateResp.
Issuer of the certificate.
:param issuer: The issuer of this TrustedCertificateResp.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this TrustedCertificateResp.
Certificate name.
:return: The name of this TrustedCertificateResp.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this TrustedCertificateResp.
Certificate name.
:param name: The name of this TrustedCertificateResp.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this TrustedCertificateResp.
Entity name: always 'trusted-cert'
:return: The object of this TrustedCertificateResp.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this TrustedCertificateResp.
Entity name: always 'trusted-cert'
:param object: The object of this TrustedCertificateResp.
:type: str
'''
pass
@property
def owner_id(self):
'''
Gets the owner_id of this TrustedCertificateResp.
The UUID of the owner.
:return: The owner_id of this TrustedCertificateResp.
:rtype: str
'''
pass
@owner_id.setter
def owner_id(self):
'''
Sets the owner_id of this TrustedCertificateResp.
The UUID of the owner.
:param owner_id: The owner_id of this TrustedCertificateResp.
:type: str
'''
pass
@property
def service(self):
'''
Gets the service of this TrustedCertificateResp.
Service name where the certificate is to be used.
:return: The service of this TrustedCertificateResp.
:rtype: str
'''
pass
@service.setter
def service(self):
'''
Sets the service of this TrustedCertificateResp.
Service name where the certificate is to be used.
:param service: The service of this TrustedCertificateResp.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this TrustedCertificateResp.
Status of the certificate.
:return: The status of this TrustedCertificateResp.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this TrustedCertificateResp.
Status of the certificate.
:param status: The status of this TrustedCertificateResp.
:type: str
'''
pass
@property
def subject(self):
'''
Gets the subject of this TrustedCertificateResp.
Subject of the certificate.
:return: The subject of this TrustedCertificateResp.
:rtype: str
'''
pass
@subject.setter
def subject(self):
'''
Sets the subject of this TrustedCertificateResp.
Subject of the certificate.
:param subject: The subject of this TrustedCertificateResp.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this TrustedCertificateResp.
Last update UTC time RFC3339.
:return: The updated_at of this TrustedCertificateResp.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this TrustedCertificateResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this TrustedCertificateResp.
:type: datetime
'''
pass
@property
def validity(self):
'''
Gets the validity of this TrustedCertificateResp.
Expiration time in UTC formatted as RFC3339.
:return: The validity of this TrustedCertificateResp.
:rtype: datetime
'''
pass
@validity.setter
def validity(self):
'''
Sets the validity of this TrustedCertificateResp.
Expiration time in UTC formatted as RFC3339.
:param validity: The validity of this TrustedCertificateResp.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 75 | 41 | 11 | 1 | 4 | 6 | 1 | 1.02 | 1 | 4 | 0 | 0 | 40 | 18 | 40 | 40 | 559 | 98 | 228 | 101 | 153 | 233 | 139 | 67 | 98 | 5 | 1 | 2 | 58 |
2,568 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/trusted_certificate_req.py
|
mbed_cloud._backends.iam.models.trusted_certificate_req.TrustedCertificateReq
|
class TrustedCertificateReq(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'certificate': 'str',
'description': 'str',
'enrollment_mode': 'bool',
'name': 'str',
'service': 'str',
'signature': 'str',
'status': 'str'
}
attribute_map = {
'certificate': 'certificate',
'description': 'description',
'enrollment_mode': 'enrollment_mode',
'name': 'name',
'service': 'service',
'signature': 'signature',
'status': 'status'
}
def __init__(self, certificate=None, description=None, enrollment_mode=None, name=None, service=None, signature=None, status=None):
"""
TrustedCertificateReq - a model defined in Swagger
"""
self._certificate = certificate
self._description = description
self._enrollment_mode = enrollment_mode
self._name = name
self._service = service
self._signature = signature
self._status = status
self.discriminator = None
@property
def certificate(self):
"""
Gets the certificate of this TrustedCertificateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:return: The certificate of this TrustedCertificateReq.
:rtype: str
"""
return self._certificate
@certificate.setter
def certificate(self, certificate):
"""
Sets the certificate of this TrustedCertificateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:param certificate: The certificate of this TrustedCertificateReq.
:type: str
"""
if certificate is None:
raise ValueError("Invalid value for `certificate`, must not be `None`")
self._certificate = certificate
@property
def description(self):
"""
Gets the description of this TrustedCertificateReq.
Human readable description of this certificate, not longer than 500 characters.
:return: The description of this TrustedCertificateReq.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this TrustedCertificateReq.
Human readable description of this certificate, not longer than 500 characters.
:param description: The description of this TrustedCertificateReq.
:type: str
"""
self._description = description
@property
def enrollment_mode(self):
"""
Gets the enrollment_mode of this TrustedCertificateReq.
Certificate is used in enrollment mode. Default value is false.
:return: The enrollment_mode of this TrustedCertificateReq.
:rtype: bool
"""
return self._enrollment_mode
@enrollment_mode.setter
def enrollment_mode(self, enrollment_mode):
"""
Sets the enrollment_mode of this TrustedCertificateReq.
Certificate is used in enrollment mode. Default value is false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateReq.
:type: bool
"""
self._enrollment_mode = enrollment_mode
@property
def name(self):
"""
Gets the name of this TrustedCertificateReq.
Certificate name, not longer than 100 characters.
:return: The name of this TrustedCertificateReq.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this TrustedCertificateReq.
Certificate name, not longer than 100 characters.
:param name: The name of this TrustedCertificateReq.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name
@property
def service(self):
"""
Gets the service of this TrustedCertificateReq.
Service name where the certificate must be used.
:return: The service of this TrustedCertificateReq.
:rtype: str
"""
return self._service
@service.setter
def service(self, service):
"""
Sets the service of this TrustedCertificateReq.
Service name where the certificate must be used.
:param service: The service of this TrustedCertificateReq.
:type: str
"""
if service is None:
raise ValueError("Invalid value for `service`, must not be `None`")
allowed_values = ["lwm2m", "bootstrap"]
if service not in allowed_values:
raise ValueError(
"Invalid value for `service` ({0}), must be one of {1}"
.format(service, allowed_values)
)
self._service = service
@property
def signature(self):
"""
Gets the signature of this TrustedCertificateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:return: The signature of this TrustedCertificateReq.
:rtype: str
"""
return self._signature
@signature.setter
def signature(self, signature):
"""
Sets the signature of this TrustedCertificateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:param signature: The signature of this TrustedCertificateReq.
:type: str
"""
self._signature = signature
@property
def status(self):
"""
Gets the status of this TrustedCertificateReq.
Status of the certificate.
:return: The status of this TrustedCertificateReq.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this TrustedCertificateReq.
Status of the certificate.
:param status: The status of this TrustedCertificateReq.
:type: str
"""
allowed_values = ["ACTIVE", "INACTIVE"]
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}"
.format(status, allowed_values)
)
self._status = status
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, TrustedCertificateReq):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class TrustedCertificateReq(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, certificate=None, description=None, enrollment_mode=None, name=None, service=None, signature=None, status=None):
'''
TrustedCertificateReq - a model defined in Swagger
'''
pass
@property
def certificate(self):
'''
Gets the certificate of this TrustedCertificateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:return: The certificate of this TrustedCertificateReq.
:rtype: str
'''
pass
@certificate.setter
def certificate(self):
'''
Sets the certificate of this TrustedCertificateReq.
A chain of X509.v3 trusted certificates in PEM format. The chain must contain all certificates from root to leaf. Otherwise, the signature parameter is required.
:param certificate: The certificate of this TrustedCertificateReq.
:type: str
'''
pass
@property
def description(self):
'''
Gets the description of this TrustedCertificateReq.
Human readable description of this certificate, not longer than 500 characters.
:return: The description of this TrustedCertificateReq.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this TrustedCertificateReq.
Human readable description of this certificate, not longer than 500 characters.
:param description: The description of this TrustedCertificateReq.
:type: str
'''
pass
@property
def enrollment_mode(self):
'''
Gets the enrollment_mode of this TrustedCertificateReq.
Certificate is used in enrollment mode. Default value is false.
:return: The enrollment_mode of this TrustedCertificateReq.
:rtype: bool
'''
pass
@enrollment_mode.setter
def enrollment_mode(self):
'''
Sets the enrollment_mode of this TrustedCertificateReq.
Certificate is used in enrollment mode. Default value is false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateReq.
:type: bool
'''
pass
@property
def name(self):
'''
Gets the name of this TrustedCertificateReq.
Certificate name, not longer than 100 characters.
:return: The name of this TrustedCertificateReq.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this TrustedCertificateReq.
Certificate name, not longer than 100 characters.
:param name: The name of this TrustedCertificateReq.
:type: str
'''
pass
@property
def service(self):
'''
Gets the service of this TrustedCertificateReq.
Service name where the certificate must be used.
:return: The service of this TrustedCertificateReq.
:rtype: str
'''
pass
@service.setter
def service(self):
'''
Sets the service of this TrustedCertificateReq.
Service name where the certificate must be used.
:param service: The service of this TrustedCertificateReq.
:type: str
'''
pass
@property
def signature(self):
'''
Gets the signature of this TrustedCertificateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:return: The signature of this TrustedCertificateReq.
:rtype: str
'''
pass
@signature.setter
def signature(self):
'''
Sets the signature of this TrustedCertificateReq.
DEPRECATED: Base64 encoded signature of the account ID signed by the certificate to be uploaded. The signature must be hashed with SHA256.
:param signature: The signature of this TrustedCertificateReq.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this TrustedCertificateReq.
Status of the certificate.
:return: The status of this TrustedCertificateReq.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this TrustedCertificateReq.
Status of the certificate.
:param status: The status of this TrustedCertificateReq.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 11 | 1 | 4 | 5 | 2 | 0.96 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 279 | 48 | 118 | 50 | 83 | 113 | 72 | 36 | 51 | 5 | 1 | 2 | 30 |
2,569 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/trusted_certificate_internal_resp_list.py
|
mbed_cloud._backends.iam.models.trusted_certificate_internal_resp_list.TrustedCertificateInternalRespList
|
class TrustedCertificateInternalRespList(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[TrustedCertificateInternalResp]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
TrustedCertificateInternalRespList - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this TrustedCertificateInternalRespList.
The entity ID to fetch after the given one.
:return: The after of this TrustedCertificateInternalRespList.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this TrustedCertificateInternalRespList.
The entity ID to fetch after the given one.
:param after: The after of this TrustedCertificateInternalRespList.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this TrustedCertificateInternalRespList.
A list of entities.
:return: The data of this TrustedCertificateInternalRespList.
:rtype: list[TrustedCertificateInternalResp]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this TrustedCertificateInternalRespList.
A list of entities.
:param data: The data of this TrustedCertificateInternalRespList.
:type: list[TrustedCertificateInternalResp]
"""
if data is None:
raise ValueError("Invalid value for `data`, must not be `None`")
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this TrustedCertificateInternalRespList.
Flag indicating whether there is more results.
:return: The has_more of this TrustedCertificateInternalRespList.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this TrustedCertificateInternalRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this TrustedCertificateInternalRespList.
:type: bool
"""
if has_more is None:
raise ValueError("Invalid value for `has_more`, must not be `None`")
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this TrustedCertificateInternalRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this TrustedCertificateInternalRespList.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this TrustedCertificateInternalRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this TrustedCertificateInternalRespList.
:type: int
"""
if limit is None:
raise ValueError("Invalid value for `limit`, must not be `None`")
self._limit = limit
@property
def object(self):
"""
Gets the object of this TrustedCertificateInternalRespList.
Entity name: always 'list'
:return: The object of this TrustedCertificateInternalRespList.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this TrustedCertificateInternalRespList.
Entity name: always 'list'
:param object: The object of this TrustedCertificateInternalRespList.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["list"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def order(self):
"""
Gets the order of this TrustedCertificateInternalRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this TrustedCertificateInternalRespList.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this TrustedCertificateInternalRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this TrustedCertificateInternalRespList.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this TrustedCertificateInternalRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this TrustedCertificateInternalRespList.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this TrustedCertificateInternalRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this TrustedCertificateInternalRespList.
:type: int
"""
if total_count is None:
raise ValueError("Invalid value for `total_count`, must not be `None`")
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, TrustedCertificateInternalRespList):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class TrustedCertificateInternalRespList(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
TrustedCertificateInternalRespList - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this TrustedCertificateInternalRespList.
The entity ID to fetch after the given one.
:return: The after of this TrustedCertificateInternalRespList.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this TrustedCertificateInternalRespList.
The entity ID to fetch after the given one.
:param after: The after of this TrustedCertificateInternalRespList.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this TrustedCertificateInternalRespList.
A list of entities.
:return: The data of this TrustedCertificateInternalRespList.
:rtype: list[TrustedCertificateInternalResp]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this TrustedCertificateInternalRespList.
A list of entities.
:param data: The data of this TrustedCertificateInternalRespList.
:type: list[TrustedCertificateInternalResp]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this TrustedCertificateInternalRespList.
Flag indicating whether there is more results.
:return: The has_more of this TrustedCertificateInternalRespList.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this TrustedCertificateInternalRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this TrustedCertificateInternalRespList.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this TrustedCertificateInternalRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this TrustedCertificateInternalRespList.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this TrustedCertificateInternalRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this TrustedCertificateInternalRespList.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this TrustedCertificateInternalRespList.
Entity name: always 'list'
:return: The object of this TrustedCertificateInternalRespList.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this TrustedCertificateInternalRespList.
Entity name: always 'list'
:param object: The object of this TrustedCertificateInternalRespList.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this TrustedCertificateInternalRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this TrustedCertificateInternalRespList.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this TrustedCertificateInternalRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this TrustedCertificateInternalRespList.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this TrustedCertificateInternalRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this TrustedCertificateInternalRespList.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this TrustedCertificateInternalRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this TrustedCertificateInternalRespList.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 11 | 1 | 4 | 5 | 2 | 0.93 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 283 | 48 | 122 | 50 | 87 | 113 | 76 | 36 | 55 | 5 | 1 | 2 | 32 |
2,570 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/trusted_certificate_internal_resp.py
|
mbed_cloud._backends.iam.models.trusted_certificate_internal_resp.TrustedCertificateInternalResp
|
class TrustedCertificateInternalResp(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account_id': 'str',
'certificate': 'str',
'created_at': 'datetime',
'description': 'str',
'device_execution_mode': 'int',
'enrollment_mode': 'bool',
'etag': 'str',
'id': 'str',
'issuer': 'str',
'name': 'str',
'object': 'str',
'owner_id': 'str',
'private_key': 'str',
'service': 'str',
'status': 'str',
'subject': 'str',
'updated_at': 'datetime',
'validity': 'datetime'
}
attribute_map = {
'account_id': 'account_id',
'certificate': 'certificate',
'created_at': 'created_at',
'description': 'description',
'device_execution_mode': 'device_execution_mode',
'enrollment_mode': 'enrollment_mode',
'etag': 'etag',
'id': 'id',
'issuer': 'issuer',
'name': 'name',
'object': 'object',
'owner_id': 'owner_id',
'private_key': 'private_key',
'service': 'service',
'status': 'status',
'subject': 'subject',
'updated_at': 'updated_at',
'validity': 'validity'
}
def __init__(self, account_id=None, certificate=None, created_at=None, description=None, device_execution_mode=None, enrollment_mode=None, etag=None, id=None, issuer=None, name=None, object=None, owner_id=None, private_key=None, service=None, status=None, subject=None, updated_at=None, validity=None):
"""
TrustedCertificateInternalResp - a model defined in Swagger
"""
self._account_id = account_id
self._certificate = certificate
self._created_at = created_at
self._description = description
self._device_execution_mode = device_execution_mode
self._enrollment_mode = enrollment_mode
self._etag = etag
self._id = id
self._issuer = issuer
self._name = name
self._object = object
self._owner_id = owner_id
self._private_key = private_key
self._service = service
self._status = status
self._subject = subject
self._updated_at = updated_at
self._validity = validity
self.discriminator = None
@property
def account_id(self):
"""
Gets the account_id of this TrustedCertificateInternalResp.
The UUID of the account.
:return: The account_id of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._account_id
@account_id.setter
def account_id(self, account_id):
"""
Sets the account_id of this TrustedCertificateInternalResp.
The UUID of the account.
:param account_id: The account_id of this TrustedCertificateInternalResp.
:type: str
"""
if account_id is None:
raise ValueError("Invalid value for `account_id`, must not be `None`")
self._account_id = account_id
@property
def certificate(self):
"""
Gets the certificate of this TrustedCertificateInternalResp.
X509.v3 trusted certificate in PEM format.
:return: The certificate of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._certificate
@certificate.setter
def certificate(self, certificate):
"""
Sets the certificate of this TrustedCertificateInternalResp.
X509.v3 trusted certificate in PEM format.
:param certificate: The certificate of this TrustedCertificateInternalResp.
:type: str
"""
if certificate is None:
raise ValueError("Invalid value for `certificate`, must not be `None`")
self._certificate = certificate
@property
def created_at(self):
"""
Gets the created_at of this TrustedCertificateInternalResp.
Creation UTC time RFC3339.
:return: The created_at of this TrustedCertificateInternalResp.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this TrustedCertificateInternalResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this TrustedCertificateInternalResp.
:type: datetime
"""
self._created_at = created_at
@property
def description(self):
"""
Gets the description of this TrustedCertificateInternalResp.
Human readable description of this certificate.
:return: The description of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this TrustedCertificateInternalResp.
Human readable description of this certificate.
:param description: The description of this TrustedCertificateInternalResp.
:type: str
"""
self._description = description
@property
def device_execution_mode(self):
"""
Gets the device_execution_mode of this TrustedCertificateInternalResp.
Device execution mode where 1 means a developer certificate.
:return: The device_execution_mode of this TrustedCertificateInternalResp.
:rtype: int
"""
return self._device_execution_mode
@device_execution_mode.setter
def device_execution_mode(self, device_execution_mode):
"""
Sets the device_execution_mode of this TrustedCertificateInternalResp.
Device execution mode where 1 means a developer certificate.
:param device_execution_mode: The device_execution_mode of this TrustedCertificateInternalResp.
:type: int
"""
self._device_execution_mode = device_execution_mode
@property
def enrollment_mode(self):
"""
Gets the enrollment_mode of this TrustedCertificateInternalResp.
If true, signature is not required. Default value false.
:return: The enrollment_mode of this TrustedCertificateInternalResp.
:rtype: bool
"""
return self._enrollment_mode
@enrollment_mode.setter
def enrollment_mode(self, enrollment_mode):
"""
Sets the enrollment_mode of this TrustedCertificateInternalResp.
If true, signature is not required. Default value false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateInternalResp.
:type: bool
"""
self._enrollment_mode = enrollment_mode
@property
def etag(self):
"""
Gets the etag of this TrustedCertificateInternalResp.
API resource entity version.
:return: The etag of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this TrustedCertificateInternalResp.
API resource entity version.
:param etag: The etag of this TrustedCertificateInternalResp.
:type: str
"""
if etag is None:
raise ValueError("Invalid value for `etag`, must not be `None`")
self._etag = etag
@property
def id(self):
"""
Gets the id of this TrustedCertificateInternalResp.
Entity ID.
:return: The id of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this TrustedCertificateInternalResp.
Entity ID.
:param id: The id of this TrustedCertificateInternalResp.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def issuer(self):
"""
Gets the issuer of this TrustedCertificateInternalResp.
Issuer of the certificate.
:return: The issuer of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._issuer
@issuer.setter
def issuer(self, issuer):
"""
Sets the issuer of this TrustedCertificateInternalResp.
Issuer of the certificate.
:param issuer: The issuer of this TrustedCertificateInternalResp.
:type: str
"""
if issuer is None:
raise ValueError("Invalid value for `issuer`, must not be `None`")
self._issuer = issuer
@property
def name(self):
"""
Gets the name of this TrustedCertificateInternalResp.
Certificate name.
:return: The name of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this TrustedCertificateInternalResp.
Certificate name.
:param name: The name of this TrustedCertificateInternalResp.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name
@property
def object(self):
"""
Gets the object of this TrustedCertificateInternalResp.
Entity name: always 'trusted-cert'
:return: The object of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this TrustedCertificateInternalResp.
Entity name: always 'trusted-cert'
:param object: The object of this TrustedCertificateInternalResp.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["trusted-cert"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def owner_id(self):
"""
Gets the owner_id of this TrustedCertificateInternalResp.
The UUID of the owner.
:return: The owner_id of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._owner_id
@owner_id.setter
def owner_id(self, owner_id):
"""
Sets the owner_id of this TrustedCertificateInternalResp.
The UUID of the owner.
:param owner_id: The owner_id of this TrustedCertificateInternalResp.
:type: str
"""
self._owner_id = owner_id
@property
def private_key(self):
"""
Gets the private_key of this TrustedCertificateInternalResp.
Private key of the certificate in PEM or base64 encoded DER format.
:return: The private_key of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._private_key
@private_key.setter
def private_key(self, private_key):
"""
Sets the private_key of this TrustedCertificateInternalResp.
Private key of the certificate in PEM or base64 encoded DER format.
:param private_key: The private_key of this TrustedCertificateInternalResp.
:type: str
"""
if private_key is None:
raise ValueError("Invalid value for `private_key`, must not be `None`")
self._private_key = private_key
@property
def service(self):
"""
Gets the service of this TrustedCertificateInternalResp.
Service name where the certificate is to be used.
:return: The service of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._service
@service.setter
def service(self, service):
"""
Sets the service of this TrustedCertificateInternalResp.
Service name where the certificate is to be used.
:param service: The service of this TrustedCertificateInternalResp.
:type: str
"""
if service is None:
raise ValueError("Invalid value for `service`, must not be `None`")
allowed_values = ["lwm2m", "bootstrap"]
if service not in allowed_values:
raise ValueError(
"Invalid value for `service` ({0}), must be one of {1}"
.format(service, allowed_values)
)
self._service = service
@property
def status(self):
"""
Gets the status of this TrustedCertificateInternalResp.
Status of the certificate.
:return: The status of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._status
@status.setter
def status(self, status):
"""
Sets the status of this TrustedCertificateInternalResp.
Status of the certificate.
:param status: The status of this TrustedCertificateInternalResp.
:type: str
"""
allowed_values = ["ACTIVE", "INACTIVE"]
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}"
.format(status, allowed_values)
)
self._status = status
@property
def subject(self):
"""
Gets the subject of this TrustedCertificateInternalResp.
Subject of the certificate.
:return: The subject of this TrustedCertificateInternalResp.
:rtype: str
"""
return self._subject
@subject.setter
def subject(self, subject):
"""
Sets the subject of this TrustedCertificateInternalResp.
Subject of the certificate.
:param subject: The subject of this TrustedCertificateInternalResp.
:type: str
"""
if subject is None:
raise ValueError("Invalid value for `subject`, must not be `None`")
self._subject = subject
@property
def updated_at(self):
"""
Gets the updated_at of this TrustedCertificateInternalResp.
Last update UTC time RFC3339.
:return: The updated_at of this TrustedCertificateInternalResp.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this TrustedCertificateInternalResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this TrustedCertificateInternalResp.
:type: datetime
"""
self._updated_at = updated_at
@property
def validity(self):
"""
Gets the validity of this TrustedCertificateInternalResp.
Expiration time in UTC formatted as RFC3339.
:return: The validity of this TrustedCertificateInternalResp.
:rtype: datetime
"""
return self._validity
@validity.setter
def validity(self, validity):
"""
Sets the validity of this TrustedCertificateInternalResp.
Expiration time in UTC formatted as RFC3339.
:param validity: The validity of this TrustedCertificateInternalResp.
:type: datetime
"""
if validity is None:
raise ValueError("Invalid value for `validity`, must not be `None`")
self._validity = validity
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, TrustedCertificateInternalResp):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class TrustedCertificateInternalResp(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, account_id=None, certificate=None, created_at=None, description=None, device_execution_mode=None, enrollment_mode=None, etag=None, id=None, issuer=None, name=None, object=None, owner_id=None, private_key=None, service=None, status=None, subject=None, updated_at=None, validity=None):
'''
TrustedCertificateInternalResp - a model defined in Swagger
'''
pass
@property
def account_id(self):
'''
Gets the account_id of this TrustedCertificateInternalResp.
The UUID of the account.
:return: The account_id of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@account_id.setter
def account_id(self):
'''
Sets the account_id of this TrustedCertificateInternalResp.
The UUID of the account.
:param account_id: The account_id of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def certificate(self):
'''
Gets the certificate of this TrustedCertificateInternalResp.
X509.v3 trusted certificate in PEM format.
:return: The certificate of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@certificate.setter
def certificate(self):
'''
Sets the certificate of this TrustedCertificateInternalResp.
X509.v3 trusted certificate in PEM format.
:param certificate: The certificate of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this TrustedCertificateInternalResp.
Creation UTC time RFC3339.
:return: The created_at of this TrustedCertificateInternalResp.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this TrustedCertificateInternalResp.
Creation UTC time RFC3339.
:param created_at: The created_at of this TrustedCertificateInternalResp.
:type: datetime
'''
pass
@property
def description(self):
'''
Gets the description of this TrustedCertificateInternalResp.
Human readable description of this certificate.
:return: The description of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this TrustedCertificateInternalResp.
Human readable description of this certificate.
:param description: The description of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def device_execution_mode(self):
'''
Gets the device_execution_mode of this TrustedCertificateInternalResp.
Device execution mode where 1 means a developer certificate.
:return: The device_execution_mode of this TrustedCertificateInternalResp.
:rtype: int
'''
pass
@device_execution_mode.setter
def device_execution_mode(self):
'''
Sets the device_execution_mode of this TrustedCertificateInternalResp.
Device execution mode where 1 means a developer certificate.
:param device_execution_mode: The device_execution_mode of this TrustedCertificateInternalResp.
:type: int
'''
pass
@property
def enrollment_mode(self):
'''
Gets the enrollment_mode of this TrustedCertificateInternalResp.
If true, signature is not required. Default value false.
:return: The enrollment_mode of this TrustedCertificateInternalResp.
:rtype: bool
'''
pass
@enrollment_mode.setter
def enrollment_mode(self):
'''
Sets the enrollment_mode of this TrustedCertificateInternalResp.
If true, signature is not required. Default value false.
:param enrollment_mode: The enrollment_mode of this TrustedCertificateInternalResp.
:type: bool
'''
pass
@property
def etag(self):
'''
Gets the etag of this TrustedCertificateInternalResp.
API resource entity version.
:return: The etag of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this TrustedCertificateInternalResp.
API resource entity version.
:param etag: The etag of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def id(self):
'''
Gets the id of this TrustedCertificateInternalResp.
Entity ID.
:return: The id of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this TrustedCertificateInternalResp.
Entity ID.
:param id: The id of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def issuer(self):
'''
Gets the issuer of this TrustedCertificateInternalResp.
Issuer of the certificate.
:return: The issuer of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@issuer.setter
def issuer(self):
'''
Sets the issuer of this TrustedCertificateInternalResp.
Issuer of the certificate.
:param issuer: The issuer of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this TrustedCertificateInternalResp.
Certificate name.
:return: The name of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this TrustedCertificateInternalResp.
Certificate name.
:param name: The name of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this TrustedCertificateInternalResp.
Entity name: always 'trusted-cert'
:return: The object of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this TrustedCertificateInternalResp.
Entity name: always 'trusted-cert'
:param object: The object of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def owner_id(self):
'''
Gets the owner_id of this TrustedCertificateInternalResp.
The UUID of the owner.
:return: The owner_id of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@owner_id.setter
def owner_id(self):
'''
Sets the owner_id of this TrustedCertificateInternalResp.
The UUID of the owner.
:param owner_id: The owner_id of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def private_key(self):
'''
Gets the private_key of this TrustedCertificateInternalResp.
Private key of the certificate in PEM or base64 encoded DER format.
:return: The private_key of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@private_key.setter
def private_key(self):
'''
Sets the private_key of this TrustedCertificateInternalResp.
Private key of the certificate in PEM or base64 encoded DER format.
:param private_key: The private_key of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def service(self):
'''
Gets the service of this TrustedCertificateInternalResp.
Service name where the certificate is to be used.
:return: The service of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@service.setter
def service(self):
'''
Sets the service of this TrustedCertificateInternalResp.
Service name where the certificate is to be used.
:param service: The service of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def status(self):
'''
Gets the status of this TrustedCertificateInternalResp.
Status of the certificate.
:return: The status of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@status.setter
def status(self):
'''
Sets the status of this TrustedCertificateInternalResp.
Status of the certificate.
:param status: The status of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def subject(self):
'''
Gets the subject of this TrustedCertificateInternalResp.
Subject of the certificate.
:return: The subject of this TrustedCertificateInternalResp.
:rtype: str
'''
pass
@subject.setter
def subject(self):
'''
Sets the subject of this TrustedCertificateInternalResp.
Subject of the certificate.
:param subject: The subject of this TrustedCertificateInternalResp.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this TrustedCertificateInternalResp.
Last update UTC time RFC3339.
:return: The updated_at of this TrustedCertificateInternalResp.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this TrustedCertificateInternalResp.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this TrustedCertificateInternalResp.
:type: datetime
'''
pass
@property
def validity(self):
'''
Gets the validity of this TrustedCertificateInternalResp.
Expiration time in UTC formatted as RFC3339.
:return: The validity of this TrustedCertificateInternalResp.
:rtype: datetime
'''
pass
@validity.setter
def validity(self):
'''
Sets the validity of this TrustedCertificateInternalResp.
Expiration time in UTC formatted as RFC3339.
:param validity: The validity of this TrustedCertificateInternalResp.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 79 | 43 | 11 | 1 | 4 | 6 | 1 | 1.03 | 1 | 4 | 0 | 0 | 42 | 19 | 42 | 42 | 587 | 103 | 239 | 106 | 160 | 245 | 146 | 70 | 103 | 5 | 1 | 2 | 61 |
2,571 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/subject_list.py
|
mbed_cloud._backends.iam.models.subject_list.SubjectList
|
class SubjectList(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'apikeys': 'list[str]',
'users': 'list[str]'
}
attribute_map = {
'apikeys': 'apikeys',
'users': 'users'
}
def __init__(self, apikeys=None, users=None):
"""
SubjectList - a model defined in Swagger
"""
self._apikeys = apikeys
self._users = users
self.discriminator = None
@property
def apikeys(self):
"""
Gets the apikeys of this SubjectList.
An array of API key IDs.
:return: The apikeys of this SubjectList.
:rtype: list[str]
"""
return self._apikeys
@apikeys.setter
def apikeys(self, apikeys):
"""
Sets the apikeys of this SubjectList.
An array of API key IDs.
:param apikeys: The apikeys of this SubjectList.
:type: list[str]
"""
self._apikeys = apikeys
@property
def users(self):
"""
Gets the users of this SubjectList.
An array of user IDs.
:return: The users of this SubjectList.
:rtype: list[str]
"""
return self._users
@users.setter
def users(self, users):
"""
Sets the users of this SubjectList.
An array of user IDs.
:param users: The users of this SubjectList.
:type: list[str]
"""
self._users = users
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, SubjectList):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class SubjectList(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, apikeys=None, users=None):
'''
SubjectList - a model defined in Swagger
'''
pass
@property
def apikeys(self):
'''
Gets the apikeys of this SubjectList.
An array of API key IDs.
:return: The apikeys of this SubjectList.
:rtype: list[str]
'''
pass
@apikeys.setter
def apikeys(self):
'''
Sets the apikeys of this SubjectList.
An array of API key IDs.
:param apikeys: The apikeys of this SubjectList.
:type: list[str]
'''
pass
@property
def users(self):
'''
Gets the users of this SubjectList.
An array of user IDs.
:return: The users of this SubjectList.
:rtype: list[str]
'''
pass
@users.setter
def users(self):
'''
Sets the users of this SubjectList.
An array of user IDs.
:param users: The users of this SubjectList.
:type: list[str]
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 15 | 11 | 9 | 1 | 4 | 4 | 2 | 0.96 | 1 | 3 | 0 | 0 | 10 | 3 | 10 | 10 | 131 | 23 | 55 | 23 | 40 | 53 | 35 | 19 | 24 | 5 | 1 | 2 | 15 |
2,572 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/password_policy.py
|
mbed_cloud._backends.iam.models.password_policy.PasswordPolicy
|
class PasswordPolicy(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'minimum_length': 'str'
}
attribute_map = {
'minimum_length': 'minimum_length'
}
def __init__(self, minimum_length=None):
"""
PasswordPolicy - a model defined in Swagger
"""
self._minimum_length = minimum_length
self.discriminator = None
@property
def minimum_length(self):
"""
Gets the minimum_length of this PasswordPolicy.
Minimum length for the password. A number between 8 and 512.
:return: The minimum_length of this PasswordPolicy.
:rtype: str
"""
return self._minimum_length
@minimum_length.setter
def minimum_length(self, minimum_length):
"""
Sets the minimum_length of this PasswordPolicy.
Minimum length for the password. A number between 8 and 512.
:param minimum_length: The minimum_length of this PasswordPolicy.
:type: str
"""
if minimum_length is None:
raise ValueError("Invalid value for `minimum_length`, must not be `None`")
self._minimum_length = minimum_length
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, PasswordPolicy):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class PasswordPolicy(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, minimum_length=None):
'''
PasswordPolicy - a model defined in Swagger
'''
pass
@property
def minimum_length(self):
'''
Gets the minimum_length of this PasswordPolicy.
Minimum length for the password. A number between 8 and 512.
:return: The minimum_length of this PasswordPolicy.
:rtype: str
'''
pass
@minimum_length.setter
def minimum_length(self):
'''
Sets the minimum_length of this PasswordPolicy.
Minimum length for the password. A number between 8 and 512.
:param minimum_length: The minimum_length of this PasswordPolicy.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 11 | 9 | 10 | 1 | 5 | 4 | 2 | 0.85 | 1 | 4 | 0 | 0 | 8 | 2 | 8 | 8 | 107 | 18 | 48 | 18 | 37 | 41 | 32 | 16 | 23 | 5 | 1 | 2 | 14 |
2,573 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/login_history.py
|
mbed_cloud._backends.iam.models.login_history.LoginHistory
|
class LoginHistory(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'date': 'datetime',
'ip_address': 'str',
'success': 'bool',
'user_agent': 'str'
}
attribute_map = {
'date': 'date',
'ip_address': 'ip_address',
'success': 'success',
'user_agent': 'user_agent'
}
def __init__(self, date=None, ip_address=None, success=None, user_agent=None):
"""
LoginHistory - a model defined in Swagger
"""
self._date = date
self._ip_address = ip_address
self._success = success
self._user_agent = user_agent
self.discriminator = None
@property
def date(self):
"""
Gets the date of this LoginHistory.
UTC time RFC3339 for this login attempt.
:return: The date of this LoginHistory.
:rtype: datetime
"""
return self._date
@date.setter
def date(self, date):
"""
Sets the date of this LoginHistory.
UTC time RFC3339 for this login attempt.
:param date: The date of this LoginHistory.
:type: datetime
"""
if date is None:
raise ValueError("Invalid value for `date`, must not be `None`")
self._date = date
@property
def ip_address(self):
"""
Gets the ip_address of this LoginHistory.
IP address of the client.
:return: The ip_address of this LoginHistory.
:rtype: str
"""
return self._ip_address
@ip_address.setter
def ip_address(self, ip_address):
"""
Sets the ip_address of this LoginHistory.
IP address of the client.
:param ip_address: The ip_address of this LoginHistory.
:type: str
"""
if ip_address is None:
raise ValueError("Invalid value for `ip_address`, must not be `None`")
self._ip_address = ip_address
@property
def success(self):
"""
Gets the success of this LoginHistory.
Flag indicating whether login attempt was successful or not.
:return: The success of this LoginHistory.
:rtype: bool
"""
return self._success
@success.setter
def success(self, success):
"""
Sets the success of this LoginHistory.
Flag indicating whether login attempt was successful or not.
:param success: The success of this LoginHistory.
:type: bool
"""
if success is None:
raise ValueError("Invalid value for `success`, must not be `None`")
self._success = success
@property
def user_agent(self):
"""
Gets the user_agent of this LoginHistory.
User Agent header from the login request.
:return: The user_agent of this LoginHistory.
:rtype: str
"""
return self._user_agent
@user_agent.setter
def user_agent(self, user_agent):
"""
Sets the user_agent of this LoginHistory.
User Agent header from the login request.
:param user_agent: The user_agent of this LoginHistory.
:type: str
"""
if user_agent is None:
raise ValueError("Invalid value for `user_agent`, must not be `None`")
self._user_agent = user_agent
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, LoginHistory):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class LoginHistory(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, date=None, ip_address=None, success=None, user_agent=None):
'''
LoginHistory - a model defined in Swagger
'''
pass
@property
def date(self):
'''
Gets the date of this LoginHistory.
UTC time RFC3339 for this login attempt.
:return: The date of this LoginHistory.
:rtype: datetime
'''
pass
@date.setter
def date(self):
'''
Sets the date of this LoginHistory.
UTC time RFC3339 for this login attempt.
:param date: The date of this LoginHistory.
:type: datetime
'''
pass
@property
def ip_address(self):
'''
Gets the ip_address of this LoginHistory.
IP address of the client.
:return: The ip_address of this LoginHistory.
:rtype: str
'''
pass
@ip_address.setter
def ip_address(self):
'''
Sets the ip_address of this LoginHistory.
IP address of the client.
:param ip_address: The ip_address of this LoginHistory.
:type: str
'''
pass
@property
def success(self):
'''
Gets the success of this LoginHistory.
Flag indicating whether login attempt was successful or not.
:return: The success of this LoginHistory.
:rtype: bool
'''
pass
@success.setter
def success(self):
'''
Sets the success of this LoginHistory.
Flag indicating whether login attempt was successful or not.
:param success: The success of this LoginHistory.
:type: bool
'''
pass
@property
def user_agent(self):
'''
Gets the user_agent of this LoginHistory.
User Agent header from the login request.
:return: The user_agent of this LoginHistory.
:rtype: str
'''
pass
@user_agent.setter
def user_agent(self):
'''
Sets the user_agent of this LoginHistory.
User Agent header from the login request.
:param user_agent: The user_agent of this LoginHistory.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 23 | 15 | 10 | 1 | 4 | 5 | 2 | 0.95 | 1 | 4 | 0 | 0 | 14 | 5 | 14 | 14 | 191 | 33 | 81 | 33 | 58 | 77 | 53 | 25 | 38 | 5 | 1 | 2 | 23 |
2,574 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/group_update_info.py
|
mbed_cloud._backends.iam.models.group_update_info.GroupUpdateInfo
|
class GroupUpdateInfo(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'name': 'str'
}
attribute_map = {
'name': 'name'
}
def __init__(self, name=None):
"""
GroupUpdateInfo - a model defined in Swagger
"""
self._name = name
self.discriminator = None
@property
def name(self):
"""
Gets the name of this GroupUpdateInfo.
The group name, not longer than 100 characters.
:return: The name of this GroupUpdateInfo.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this GroupUpdateInfo.
The group name, not longer than 100 characters.
:param name: The name of this GroupUpdateInfo.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, GroupUpdateInfo):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class GroupUpdateInfo(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, name=None):
'''
GroupUpdateInfo - a model defined in Swagger
'''
pass
@property
def name(self):
'''
Gets the name of this GroupUpdateInfo.
The group name, not longer than 100 characters.
:return: The name of this GroupUpdateInfo.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this GroupUpdateInfo.
The group name, not longer than 100 characters.
:param name: The name of this GroupUpdateInfo.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 11 | 9 | 10 | 1 | 5 | 4 | 2 | 0.85 | 1 | 4 | 0 | 0 | 8 | 2 | 8 | 8 | 107 | 18 | 48 | 18 | 37 | 41 | 32 | 16 | 23 | 5 | 1 | 2 | 14 |
2,575 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/group_summary_list.py
|
mbed_cloud._backends.iam.models.group_summary_list.GroupSummaryList
|
class GroupSummaryList(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[GroupSummary]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
GroupSummaryList - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this GroupSummaryList.
The entity ID to fetch after the given one.
:return: The after of this GroupSummaryList.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this GroupSummaryList.
The entity ID to fetch after the given one.
:param after: The after of this GroupSummaryList.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this GroupSummaryList.
A list of entities.
:return: The data of this GroupSummaryList.
:rtype: list[GroupSummary]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this GroupSummaryList.
A list of entities.
:param data: The data of this GroupSummaryList.
:type: list[GroupSummary]
"""
if data is None:
raise ValueError("Invalid value for `data`, must not be `None`")
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this GroupSummaryList.
Flag indicating whether there is more results.
:return: The has_more of this GroupSummaryList.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this GroupSummaryList.
Flag indicating whether there is more results.
:param has_more: The has_more of this GroupSummaryList.
:type: bool
"""
if has_more is None:
raise ValueError("Invalid value for `has_more`, must not be `None`")
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this GroupSummaryList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this GroupSummaryList.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this GroupSummaryList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this GroupSummaryList.
:type: int
"""
if limit is None:
raise ValueError("Invalid value for `limit`, must not be `None`")
self._limit = limit
@property
def object(self):
"""
Gets the object of this GroupSummaryList.
Entity name: always 'list'
:return: The object of this GroupSummaryList.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this GroupSummaryList.
Entity name: always 'list'
:param object: The object of this GroupSummaryList.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["list"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def order(self):
"""
Gets the order of this GroupSummaryList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this GroupSummaryList.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this GroupSummaryList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this GroupSummaryList.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this GroupSummaryList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this GroupSummaryList.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this GroupSummaryList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this GroupSummaryList.
:type: int
"""
if total_count is None:
raise ValueError("Invalid value for `total_count`, must not be `None`")
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, GroupSummaryList):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class GroupSummaryList(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
GroupSummaryList - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this GroupSummaryList.
The entity ID to fetch after the given one.
:return: The after of this GroupSummaryList.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this GroupSummaryList.
The entity ID to fetch after the given one.
:param after: The after of this GroupSummaryList.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this GroupSummaryList.
A list of entities.
:return: The data of this GroupSummaryList.
:rtype: list[GroupSummary]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this GroupSummaryList.
A list of entities.
:param data: The data of this GroupSummaryList.
:type: list[GroupSummary]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this GroupSummaryList.
Flag indicating whether there is more results.
:return: The has_more of this GroupSummaryList.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this GroupSummaryList.
Flag indicating whether there is more results.
:param has_more: The has_more of this GroupSummaryList.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this GroupSummaryList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this GroupSummaryList.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this GroupSummaryList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this GroupSummaryList.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this GroupSummaryList.
Entity name: always 'list'
:return: The object of this GroupSummaryList.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this GroupSummaryList.
Entity name: always 'list'
:param object: The object of this GroupSummaryList.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this GroupSummaryList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this GroupSummaryList.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this GroupSummaryList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this GroupSummaryList.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this GroupSummaryList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this GroupSummaryList.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this GroupSummaryList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this GroupSummaryList.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 11 | 1 | 4 | 5 | 2 | 0.93 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 283 | 48 | 122 | 50 | 87 | 113 | 76 | 36 | 55 | 5 | 1 | 2 | 32 |
2,576 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/group_summary.py
|
mbed_cloud._backends.iam.models.group_summary.GroupSummary
|
class GroupSummary(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'account_id': 'str',
'apikey_count': 'int',
'created_at': 'datetime',
'etag': 'str',
'id': 'str',
'name': 'str',
'object': 'str',
'updated_at': 'datetime',
'user_count': 'int'
}
attribute_map = {
'account_id': 'account_id',
'apikey_count': 'apikey_count',
'created_at': 'created_at',
'etag': 'etag',
'id': 'id',
'name': 'name',
'object': 'object',
'updated_at': 'updated_at',
'user_count': 'user_count'
}
def __init__(self, account_id=None, apikey_count=None, created_at=None, etag=None, id=None, name=None, object=None, updated_at=None, user_count=None):
"""
GroupSummary - a model defined in Swagger
"""
self._account_id = account_id
self._apikey_count = apikey_count
self._created_at = created_at
self._etag = etag
self._id = id
self._name = name
self._object = object
self._updated_at = updated_at
self._user_count = user_count
self.discriminator = None
@property
def account_id(self):
"""
Gets the account_id of this GroupSummary.
The UUID of the account this group belongs to.
:return: The account_id of this GroupSummary.
:rtype: str
"""
return self._account_id
@account_id.setter
def account_id(self, account_id):
"""
Sets the account_id of this GroupSummary.
The UUID of the account this group belongs to.
:param account_id: The account_id of this GroupSummary.
:type: str
"""
if account_id is None:
raise ValueError("Invalid value for `account_id`, must not be `None`")
self._account_id = account_id
@property
def apikey_count(self):
"""
Gets the apikey_count of this GroupSummary.
The number of API keys in this group.
:return: The apikey_count of this GroupSummary.
:rtype: int
"""
return self._apikey_count
@apikey_count.setter
def apikey_count(self, apikey_count):
"""
Sets the apikey_count of this GroupSummary.
The number of API keys in this group.
:param apikey_count: The apikey_count of this GroupSummary.
:type: int
"""
if apikey_count is None:
raise ValueError("Invalid value for `apikey_count`, must not be `None`")
self._apikey_count = apikey_count
@property
def created_at(self):
"""
Gets the created_at of this GroupSummary.
Creation UTC time RFC3339.
:return: The created_at of this GroupSummary.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this GroupSummary.
Creation UTC time RFC3339.
:param created_at: The created_at of this GroupSummary.
:type: datetime
"""
self._created_at = created_at
@property
def etag(self):
"""
Gets the etag of this GroupSummary.
API resource entity version.
:return: The etag of this GroupSummary.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this GroupSummary.
API resource entity version.
:param etag: The etag of this GroupSummary.
:type: str
"""
if etag is None:
raise ValueError("Invalid value for `etag`, must not be `None`")
self._etag = etag
@property
def id(self):
"""
Gets the id of this GroupSummary.
The UUID of the group.
:return: The id of this GroupSummary.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this GroupSummary.
The UUID of the group.
:param id: The id of this GroupSummary.
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`")
self._id = id
@property
def name(self):
"""
Gets the name of this GroupSummary.
The name of the group.
:return: The name of this GroupSummary.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this GroupSummary.
The name of the group.
:param name: The name of this GroupSummary.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name
@property
def object(self):
"""
Gets the object of this GroupSummary.
Entity name: always 'group'
:return: The object of this GroupSummary.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this GroupSummary.
Entity name: always 'group'
:param object: The object of this GroupSummary.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["group"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def updated_at(self):
"""
Gets the updated_at of this GroupSummary.
Last update UTC time RFC3339.
:return: The updated_at of this GroupSummary.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this GroupSummary.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this GroupSummary.
:type: datetime
"""
self._updated_at = updated_at
@property
def user_count(self):
"""
Gets the user_count of this GroupSummary.
The number of users in this group.
:return: The user_count of this GroupSummary.
:rtype: int
"""
return self._user_count
@user_count.setter
def user_count(self, user_count):
"""
Sets the user_count of this GroupSummary.
The number of users in this group.
:param user_count: The user_count of this GroupSummary.
:type: int
"""
if user_count is None:
raise ValueError("Invalid value for `user_count`, must not be `None`")
self._user_count = user_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, GroupSummary):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class GroupSummary(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, account_id=None, apikey_count=None, created_at=None, etag=None, id=None, name=None, object=None, updated_at=None, user_count=None):
'''
GroupSummary - a model defined in Swagger
'''
pass
@property
def account_id(self):
'''
Gets the account_id of this GroupSummary.
The UUID of the account this group belongs to.
:return: The account_id of this GroupSummary.
:rtype: str
'''
pass
@account_id.setter
def account_id(self):
'''
Sets the account_id of this GroupSummary.
The UUID of the account this group belongs to.
:param account_id: The account_id of this GroupSummary.
:type: str
'''
pass
@property
def apikey_count(self):
'''
Gets the apikey_count of this GroupSummary.
The number of API keys in this group.
:return: The apikey_count of this GroupSummary.
:rtype: int
'''
pass
@apikey_count.setter
def apikey_count(self):
'''
Sets the apikey_count of this GroupSummary.
The number of API keys in this group.
:param apikey_count: The apikey_count of this GroupSummary.
:type: int
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this GroupSummary.
Creation UTC time RFC3339.
:return: The created_at of this GroupSummary.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this GroupSummary.
Creation UTC time RFC3339.
:param created_at: The created_at of this GroupSummary.
:type: datetime
'''
pass
@property
def etag(self):
'''
Gets the etag of this GroupSummary.
API resource entity version.
:return: The etag of this GroupSummary.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this GroupSummary.
API resource entity version.
:param etag: The etag of this GroupSummary.
:type: str
'''
pass
@property
def id(self):
'''
Gets the id of this GroupSummary.
The UUID of the group.
:return: The id of this GroupSummary.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this GroupSummary.
The UUID of the group.
:param id: The id of this GroupSummary.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this GroupSummary.
The name of the group.
:return: The name of this GroupSummary.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this GroupSummary.
The name of the group.
:param name: The name of this GroupSummary.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this GroupSummary.
Entity name: always 'group'
:return: The object of this GroupSummary.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this GroupSummary.
Entity name: always 'group'
:param object: The object of this GroupSummary.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this GroupSummary.
Last update UTC time RFC3339.
:return: The updated_at of this GroupSummary.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this GroupSummary.
Last update UTC time RFC3339.
:param updated_at: The updated_at of this GroupSummary.
:type: datetime
'''
pass
@property
def user_count(self):
'''
Gets the user_count of this GroupSummary.
The number of users in this group.
:return: The user_count of this GroupSummary.
:rtype: int
'''
pass
@user_count.setter
def user_count(self):
'''
Sets the user_count of this GroupSummary.
The number of users in this group.
:param user_count: The user_count of this GroupSummary.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 43 | 25 | 11 | 1 | 4 | 5 | 2 | 0.99 | 1 | 4 | 0 | 0 | 24 | 10 | 24 | 24 | 333 | 58 | 138 | 59 | 95 | 137 | 87 | 41 | 62 | 5 | 1 | 2 | 37 |
2,577 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/group_creation_info.py
|
mbed_cloud._backends.iam.models.group_creation_info.GroupCreationInfo
|
class GroupCreationInfo(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'members': 'SubjectList',
'name': 'str'
}
attribute_map = {
'members': 'members',
'name': 'name'
}
def __init__(self, members=None, name=None):
"""
GroupCreationInfo - a model defined in Swagger
"""
self._members = members
self._name = name
self.discriminator = None
@property
def members(self):
"""
Gets the members of this GroupCreationInfo.
The members of the group as arrays of user and API key UUIDs.
:return: The members of this GroupCreationInfo.
:rtype: SubjectList
"""
return self._members
@members.setter
def members(self, members):
"""
Sets the members of this GroupCreationInfo.
The members of the group as arrays of user and API key UUIDs.
:param members: The members of this GroupCreationInfo.
:type: SubjectList
"""
self._members = members
@property
def name(self):
"""
Gets the name of this GroupCreationInfo.
The group name, not longer than 100 characters.
:return: The name of this GroupCreationInfo.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this GroupCreationInfo.
The group name, not longer than 100 characters.
:param name: The name of this GroupCreationInfo.
:type: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`")
self._name = name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, GroupCreationInfo):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class GroupCreationInfo(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, members=None, name=None):
'''
GroupCreationInfo - a model defined in Swagger
'''
pass
@property
def members(self):
'''
Gets the members of this GroupCreationInfo.
The members of the group as arrays of user and API key UUIDs.
:return: The members of this GroupCreationInfo.
:rtype: SubjectList
'''
pass
@members.setter
def members(self):
'''
Sets the members of this GroupCreationInfo.
The members of the group as arrays of user and API key UUIDs.
:param members: The members of this GroupCreationInfo.
:type: SubjectList
'''
pass
@property
def name(self):
'''
Gets the name of this GroupCreationInfo.
The group name, not longer than 100 characters.
:return: The name of this GroupCreationInfo.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this GroupCreationInfo.
The group name, not longer than 100 characters.
:param name: The name of this GroupCreationInfo.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 15 | 11 | 10 | 1 | 4 | 4 | 2 | 0.93 | 1 | 4 | 0 | 0 | 10 | 3 | 10 | 10 | 133 | 23 | 57 | 23 | 42 | 53 | 37 | 19 | 26 | 5 | 1 | 2 | 16 |
2,578 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/iam/models/trusted_certificate_resp_list.py
|
mbed_cloud._backends.iam.models.trusted_certificate_resp_list.TrustedCertificateRespList
|
class TrustedCertificateRespList(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[TrustedCertificateResp]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'order': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'order': 'order',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
"""
TrustedCertificateRespList - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._order = order
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this TrustedCertificateRespList.
The entity ID to fetch after the given one.
:return: The after of this TrustedCertificateRespList.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this TrustedCertificateRespList.
The entity ID to fetch after the given one.
:param after: The after of this TrustedCertificateRespList.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this TrustedCertificateRespList.
A list of entities.
:return: The data of this TrustedCertificateRespList.
:rtype: list[TrustedCertificateResp]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this TrustedCertificateRespList.
A list of entities.
:param data: The data of this TrustedCertificateRespList.
:type: list[TrustedCertificateResp]
"""
if data is None:
raise ValueError("Invalid value for `data`, must not be `None`")
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this TrustedCertificateRespList.
Flag indicating whether there is more results.
:return: The has_more of this TrustedCertificateRespList.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this TrustedCertificateRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this TrustedCertificateRespList.
:type: bool
"""
if has_more is None:
raise ValueError("Invalid value for `has_more`, must not be `None`")
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this TrustedCertificateRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this TrustedCertificateRespList.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this TrustedCertificateRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this TrustedCertificateRespList.
:type: int
"""
if limit is None:
raise ValueError("Invalid value for `limit`, must not be `None`")
self._limit = limit
@property
def object(self):
"""
Gets the object of this TrustedCertificateRespList.
Entity name: always 'list'
:return: The object of this TrustedCertificateRespList.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this TrustedCertificateRespList.
Entity name: always 'list'
:param object: The object of this TrustedCertificateRespList.
:type: str
"""
if object is None:
raise ValueError("Invalid value for `object`, must not be `None`")
allowed_values = ["list"]
if object not in allowed_values:
raise ValueError(
"Invalid value for `object` ({0}), must be one of {1}"
.format(object, allowed_values)
)
self._object = object
@property
def order(self):
"""
Gets the order of this TrustedCertificateRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this TrustedCertificateRespList.
:rtype: str
"""
return self._order
@order.setter
def order(self, order):
"""
Sets the order of this TrustedCertificateRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this TrustedCertificateRespList.
:type: str
"""
allowed_values = ["ASC", "DESC"]
if order not in allowed_values:
raise ValueError(
"Invalid value for `order` ({0}), must be one of {1}"
.format(order, allowed_values)
)
self._order = order
@property
def total_count(self):
"""
Gets the total_count of this TrustedCertificateRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this TrustedCertificateRespList.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this TrustedCertificateRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this TrustedCertificateRespList.
:type: int
"""
if total_count is None:
raise ValueError("Invalid value for `total_count`, must not be `None`")
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, TrustedCertificateRespList):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class TrustedCertificateRespList(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, order=None, total_count=None):
'''
TrustedCertificateRespList - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this TrustedCertificateRespList.
The entity ID to fetch after the given one.
:return: The after of this TrustedCertificateRespList.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this TrustedCertificateRespList.
The entity ID to fetch after the given one.
:param after: The after of this TrustedCertificateRespList.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this TrustedCertificateRespList.
A list of entities.
:return: The data of this TrustedCertificateRespList.
:rtype: list[TrustedCertificateResp]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this TrustedCertificateRespList.
A list of entities.
:param data: The data of this TrustedCertificateRespList.
:type: list[TrustedCertificateResp]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this TrustedCertificateRespList.
Flag indicating whether there is more results.
:return: The has_more of this TrustedCertificateRespList.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this TrustedCertificateRespList.
Flag indicating whether there is more results.
:param has_more: The has_more of this TrustedCertificateRespList.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this TrustedCertificateRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:return: The limit of this TrustedCertificateRespList.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this TrustedCertificateRespList.
The number of results to return, (range: 2-1000), or equals to `total_count`
:param limit: The limit of this TrustedCertificateRespList.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this TrustedCertificateRespList.
Entity name: always 'list'
:return: The object of this TrustedCertificateRespList.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this TrustedCertificateRespList.
Entity name: always 'list'
:param object: The object of this TrustedCertificateRespList.
:type: str
'''
pass
@property
def order(self):
'''
Gets the order of this TrustedCertificateRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:return: The order of this TrustedCertificateRespList.
:rtype: str
'''
pass
@order.setter
def order(self):
'''
Sets the order of this TrustedCertificateRespList.
The order of the records to return based on creation time. Available values: ASC, DESC; by default ASC.
:param order: The order of this TrustedCertificateRespList.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this TrustedCertificateRespList.
The total number or records, if requested. It might be returned also for small lists.
:return: The total_count of this TrustedCertificateRespList.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this TrustedCertificateRespList.
The total number or records, if requested. It might be returned also for small lists.
:param total_count: The total_count of this TrustedCertificateRespList.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 35 | 21 | 11 | 1 | 4 | 5 | 2 | 0.93 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 283 | 48 | 122 | 50 | 87 | 113 | 76 | 36 | 55 | 5 | 1 | 2 | 32 |
2,579 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/campaign_metrics.py
|
mbed_cloud._backends.update_service.models.campaign_metrics.CampaignMetrics
|
class CampaignMetrics(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'created_at': 'datetime',
'failed_count': 'int',
'object': 'str',
'pending_count': 'int',
'success_count': 'int',
'total_count': 'int'
}
attribute_map = {
'created_at': 'created_at',
'failed_count': 'failed_count',
'object': 'object',
'pending_count': 'pending_count',
'success_count': 'success_count',
'total_count': 'total_count'
}
def __init__(self, created_at=None, failed_count=None, object=None, pending_count=None, success_count=None, total_count=None):
"""
CampaignMetrics - a model defined in Swagger
"""
self._created_at = created_at
self._failed_count = failed_count
self._object = object
self._pending_count = pending_count
self._success_count = success_count
self._total_count = total_count
self.discriminator = None
@property
def created_at(self):
"""
Gets the created_at of this CampaignMetrics.
The time the metrics were created.
:return: The created_at of this CampaignMetrics.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this CampaignMetrics.
The time the metrics were created.
:param created_at: The created_at of this CampaignMetrics.
:type: datetime
"""
self._created_at = created_at
@property
def failed_count(self):
"""
Gets the failed_count of this CampaignMetrics.
Running total of devices that could not be updated.
:return: The failed_count of this CampaignMetrics.
:rtype: int
"""
return self._failed_count
@failed_count.setter
def failed_count(self, failed_count):
"""
Sets the failed_count of this CampaignMetrics.
Running total of devices that could not be updated.
:param failed_count: The failed_count of this CampaignMetrics.
:type: int
"""
self._failed_count = failed_count
@property
def object(self):
"""
Gets the object of this CampaignMetrics.
Entity name: always 'update-campaign-metrics'
:return: The object of this CampaignMetrics.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this CampaignMetrics.
Entity name: always 'update-campaign-metrics'
:param object: The object of this CampaignMetrics.
:type: str
"""
self._object = object
@property
def pending_count(self):
"""
Gets the pending_count of this CampaignMetrics.
Running total of devices that have yet to receive an update or are applying an update.
:return: The pending_count of this CampaignMetrics.
:rtype: int
"""
return self._pending_count
@pending_count.setter
def pending_count(self, pending_count):
"""
Sets the pending_count of this CampaignMetrics.
Running total of devices that have yet to receive an update or are applying an update.
:param pending_count: The pending_count of this CampaignMetrics.
:type: int
"""
self._pending_count = pending_count
@property
def success_count(self):
"""
Gets the success_count of this CampaignMetrics.
Running total of successfully updated devices.
:return: The success_count of this CampaignMetrics.
:rtype: int
"""
return self._success_count
@success_count.setter
def success_count(self, success_count):
"""
Sets the success_count of this CampaignMetrics.
Running total of successfully updated devices.
:param success_count: The success_count of this CampaignMetrics.
:type: int
"""
self._success_count = success_count
@property
def total_count(self):
"""
Gets the total_count of this CampaignMetrics.
Number of devices in the campaign.
:return: The total_count of this CampaignMetrics.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this CampaignMetrics.
Number of devices in the campaign.
:param total_count: The total_count of this CampaignMetrics.
:type: int
"""
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, CampaignMetrics):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class CampaignMetrics(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, created_at=None, failed_count=None, object=None, pending_count=None, success_count=None, total_count=None):
'''
CampaignMetrics - a model defined in Swagger
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this CampaignMetrics.
The time the metrics were created.
:return: The created_at of this CampaignMetrics.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this CampaignMetrics.
The time the metrics were created.
:param created_at: The created_at of this CampaignMetrics.
:type: datetime
'''
pass
@property
def failed_count(self):
'''
Gets the failed_count of this CampaignMetrics.
Running total of devices that could not be updated.
:return: The failed_count of this CampaignMetrics.
:rtype: int
'''
pass
@failed_count.setter
def failed_count(self):
'''
Sets the failed_count of this CampaignMetrics.
Running total of devices that could not be updated.
:param failed_count: The failed_count of this CampaignMetrics.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this CampaignMetrics.
Entity name: always 'update-campaign-metrics'
:return: The object of this CampaignMetrics.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this CampaignMetrics.
Entity name: always 'update-campaign-metrics'
:param object: The object of this CampaignMetrics.
:type: str
'''
pass
@property
def pending_count(self):
'''
Gets the pending_count of this CampaignMetrics.
Running total of devices that have yet to receive an update or are applying an update.
:return: The pending_count of this CampaignMetrics.
:rtype: int
'''
pass
@pending_count.setter
def pending_count(self):
'''
Sets the pending_count of this CampaignMetrics.
Running total of devices that have yet to receive an update or are applying an update.
:param pending_count: The pending_count of this CampaignMetrics.
:type: int
'''
pass
@property
def success_count(self):
'''
Gets the success_count of this CampaignMetrics.
Running total of successfully updated devices.
:return: The success_count of this CampaignMetrics.
:rtype: int
'''
pass
@success_count.setter
def success_count(self):
'''
Sets the success_count of this CampaignMetrics.
Running total of successfully updated devices.
:param success_count: The success_count of this CampaignMetrics.
:type: int
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this CampaignMetrics.
Number of devices in the campaign.
:return: The total_count of this CampaignMetrics.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this CampaignMetrics.
Number of devices in the campaign.
:param total_count: The total_count of this CampaignMetrics.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 31 | 19 | 10 | 1 | 3 | 5 | 1 | 1.11 | 1 | 3 | 0 | 0 | 18 | 7 | 18 | 18 | 235 | 43 | 91 | 43 | 60 | 101 | 55 | 31 | 36 | 5 | 1 | 2 | 23 |
2,580 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/apis/resources_api.py
|
mbed_cloud._backends.mds.apis.resources_api.ResourcesApi
|
class ResourcesApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def delete_resource_path(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Delete a resource path # noqa: E501
A request to delete a resource path must be handled by both Device Management Client and Device Management Connect. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. **Example usage:** curl -X DELETE \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_path(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.delete_resource_path_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
else:
(data) = self.delete_resource_path_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
return data
def delete_resource_path_with_http_info(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Delete a resource path # noqa: E501
A request to delete a resource path must be handled by both Device Management Client and Device Management Connect. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. **Example usage:** curl -X DELETE \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_path_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', '_resource_path', 'no_resp'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_resource_path" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `delete_resource_path`") # noqa: E501
# verify the required parameter '_resource_path' is set
if ('_resource_path' not in params or
params['_resource_path'] is None):
raise ValueError("Missing the required parameter `_resource_path` when calling `delete_resource_path`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
if '_resource_path' in params:
path_params['resourcePath'] = params['_resource_path'] # noqa: E501
query_params = []
if 'no_resp' in params:
query_params.append(('noResp', params['no_resp'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/endpoints/{device-id}/{resourcePath}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='AsyncID', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def execute_or_create_resource(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Execute a function on a Resource or create new Object instance # noqa: E501
With this API, you can [execute a function](/docs/current/connecting/handle-resource-webapp.html#the-execute-operation) on an existing resource and create new Object instance to the device. The resource-path does not have to exist - it can be created by the call. The maximum length of resource-path is 255 characters. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example resets the min and max values of the [temperature sensor](http://www.openmobilealliance.org/tech/profiles/lwm2m/3303.xml) instance 0 by executing the Resource 5605 'Reset Min and Max Measured Values'. curl -X POST \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3303/0/5605 \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.execute_or_create_resource(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param str resource_function: This value is not needed. Most of the time resources do not accept a function but they have their own functions predefined. You can use this to trigger them. If a function is included, the body of this request is passed as a char* to the function in Device Management Client.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.execute_or_create_resource_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
else:
(data) = self.execute_or_create_resource_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
return data
def execute_or_create_resource_with_http_info(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Execute a function on a Resource or create new Object instance # noqa: E501
With this API, you can [execute a function](/docs/current/connecting/handle-resource-webapp.html#the-execute-operation) on an existing resource and create new Object instance to the device. The resource-path does not have to exist - it can be created by the call. The maximum length of resource-path is 255 characters. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example resets the min and max values of the [temperature sensor](http://www.openmobilealliance.org/tech/profiles/lwm2m/3303.xml) instance 0 by executing the Resource 5605 'Reset Min and Max Measured Values'. curl -X POST \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3303/0/5605 \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.execute_or_create_resource_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param str resource_function: This value is not needed. Most of the time resources do not accept a function but they have their own functions predefined. You can use this to trigger them. If a function is included, the body of this request is passed as a char* to the function in Device Management Client.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', '_resource_path', 'resource_function', 'no_resp'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method execute_or_create_resource" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `execute_or_create_resource`") # noqa: E501
# verify the required parameter '_resource_path' is set
if ('_resource_path' not in params or
params['_resource_path'] is None):
raise ValueError("Missing the required parameter `_resource_path` when calling `execute_or_create_resource`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
if '_resource_path' in params:
path_params['resourcePath'] = params['_resource_path'] # noqa: E501
query_params = []
if 'no_resp' in params:
query_params.append(('noResp', params['no_resp'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'resource_function' in params:
body_params = params['resource_function']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['text/plain', 'application/xml', 'application/octet-stream', 'application/exi', 'application/json', 'application/link-format', 'application/senml+json', 'application/nanoservice-tlv', 'application/vnd.oma.lwm2m+text', 'application/vnd.oma.lwm2m+opaq', 'application/vnd.oma.lwm2m+tlv', 'application/vnd.oma.lwm2m+json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/endpoints/{device-id}/{resourcePath}', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='AsyncID', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_resource_value(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Read from a resource # noqa: E501
Requests the resource value and when the response is available, an `AsyncIDResponse` json object is received in the notification channel. The preferred way to get resource values is to use the **subscribe** and **callback** methods. All resource APIs are asynchronous. These APIs only respond if the device is turned on and connected to Device Management. Please refer to [Lightweight Machine to Machine Technical specification](http://www.openmobilealliance.org/release/LightweightM2M/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf) for more inforamtion. **Example usage:** curl -X GET \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_resource_value(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: Unique Device Management device ID for the endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool cache_only: If true, the response comes only from the cache. Default: false. Device Management Connect caches the received resource values for the time of [max_age](/docs/current/connecting/working-with-the-resources.html) defined in the client side.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter `noResp`. If a request is made with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_resource_value_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
else:
(data) = self.get_resource_value_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
return data
def get_resource_value_with_http_info(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Read from a resource # noqa: E501
Requests the resource value and when the response is available, an `AsyncIDResponse` json object is received in the notification channel. The preferred way to get resource values is to use the **subscribe** and **callback** methods. All resource APIs are asynchronous. These APIs only respond if the device is turned on and connected to Device Management. Please refer to [Lightweight Machine to Machine Technical specification](http://www.openmobilealliance.org/release/LightweightM2M/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf) for more inforamtion. **Example usage:** curl -X GET \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_resource_value_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: Unique Device Management device ID for the endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool cache_only: If true, the response comes only from the cache. Default: false. Device Management Connect caches the received resource values for the time of [max_age](/docs/current/connecting/working-with-the-resources.html) defined in the client side.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter `noResp`. If a request is made with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', '_resource_path', 'cache_only', 'no_resp'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_resource_value" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `get_resource_value`") # noqa: E501
# verify the required parameter '_resource_path' is set
if ('_resource_path' not in params or
params['_resource_path'] is None):
raise ValueError("Missing the required parameter `_resource_path` when calling `get_resource_value`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
if '_resource_path' in params:
path_params['resourcePath'] = params['_resource_path'] # noqa: E501
query_params = []
if 'cache_only' in params:
query_params.append(('cacheOnly', params['cache_only'])) # noqa: E501
if 'no_resp' in params:
query_params.append(('noResp', params['no_resp'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/endpoints/{device-id}/{resourcePath}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_resource_value(self, device_id, _resource_path, resource_value, **kwargs): # noqa: E501
"""Write to a resource or use write-attributes for a resource # noqa: E501
With this API, you can [write a new value to existing resources](/docs/current/connecting/handle-resource-webapp.html) or [use the write-attributes](/docs/current/connecting/resource-change-webapp.html) for a resource. This API can also be used to transfer files to the device. Device Management Connect LwM2M server implements the Option 1 from RFC7959. The maximum block size is 1024 bytes. The block size versus transferred file size is something to note in low quality networks. The customer application needs to know what type of file is transferred (for example txt) and the payload can be encrypted by the customer. The maximum size of payload is 1048576 bytes. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example sets the alarm on a buzzer. The command writes the [Buzzer](http://www.openmobilealliance.org/tech/profiles/lwm2m/3338.xml) instance 0, \"On/Off\" boolean resource to '1'. curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3338/0/5850 -H \"content-type: text/plain\" \\ -H 'authorization: Bearer {api-key}' -d '1' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_resource_value(device_id, _resource_path, resource_value, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: Resource URL. (required)
:param str resource_value: The value to be set to the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_resource_value_with_http_info(device_id, _resource_path, resource_value, **kwargs) # noqa: E501
else:
(data) = self.update_resource_value_with_http_info(device_id, _resource_path, resource_value, **kwargs) # noqa: E501
return data
def update_resource_value_with_http_info(self, device_id, _resource_path, resource_value, **kwargs): # noqa: E501
"""Write to a resource or use write-attributes for a resource # noqa: E501
With this API, you can [write a new value to existing resources](/docs/current/connecting/handle-resource-webapp.html) or [use the write-attributes](/docs/current/connecting/resource-change-webapp.html) for a resource. This API can also be used to transfer files to the device. Device Management Connect LwM2M server implements the Option 1 from RFC7959. The maximum block size is 1024 bytes. The block size versus transferred file size is something to note in low quality networks. The customer application needs to know what type of file is transferred (for example txt) and the payload can be encrypted by the customer. The maximum size of payload is 1048576 bytes. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example sets the alarm on a buzzer. The command writes the [Buzzer](http://www.openmobilealliance.org/tech/profiles/lwm2m/3338.xml) instance 0, \"On/Off\" boolean resource to '1'. curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3338/0/5850 -H \"content-type: text/plain\" \\ -H 'authorization: Bearer {api-key}' -d '1' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_resource_value_with_http_info(device_id, _resource_path, resource_value, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: Resource URL. (required)
:param str resource_value: The value to be set to the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', '_resource_path', 'resource_value', 'no_resp'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_resource_value" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `update_resource_value`") # noqa: E501
# verify the required parameter '_resource_path' is set
if ('_resource_path' not in params or
params['_resource_path'] is None):
raise ValueError("Missing the required parameter `_resource_path` when calling `update_resource_value`") # noqa: E501
# verify the required parameter 'resource_value' is set
if ('resource_value' not in params or
params['resource_value'] is None):
raise ValueError("Missing the required parameter `resource_value` when calling `update_resource_value`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
if '_resource_path' in params:
path_params['resourcePath'] = params['_resource_path'] # noqa: E501
query_params = []
if 'no_resp' in params:
query_params.append(('noResp', params['no_resp'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'resource_value' in params:
body_params = params['resource_value']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['text/plain', 'application/xml', 'application/octet-stream', 'application/exi', 'application/json', 'application/link-format', 'application/senml+json', 'application/nanoservice-tlv', 'application/vnd.oma.lwm2m+text', 'application/vnd.oma.lwm2m+opaq', 'application/vnd.oma.lwm2m+tlv', 'application/vnd.oma.lwm2m+json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/endpoints/{device-id}/{resourcePath}', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='AsyncID', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class ResourcesApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def delete_resource_path(self, device_id, _resource_path, **kwargs):
'''Delete a resource path # noqa: E501
A request to delete a resource path must be handled by both Device Management Client and Device Management Connect. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. **Example usage:** curl -X DELETE \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_path(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_resource_path_with_http_info(self, device_id, _resource_path, **kwargs):
'''Delete a resource path # noqa: E501
A request to delete a resource path must be handled by both Device Management Client and Device Management Connect. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. **Example usage:** curl -X DELETE \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_path_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
'''
pass
def execute_or_create_resource(self, device_id, _resource_path, **kwargs):
'''Execute a function on a Resource or create new Object instance # noqa: E501
With this API, you can [execute a function](/docs/current/connecting/handle-resource-webapp.html#the-execute-operation) on an existing resource and create new Object instance to the device. The resource-path does not have to exist - it can be created by the call. The maximum length of resource-path is 255 characters. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example resets the min and max values of the [temperature sensor](http://www.openmobilealliance.org/tech/profiles/lwm2m/3303.xml) instance 0 by executing the Resource 5605 'Reset Min and Max Measured Values'. curl -X POST \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3303/0/5605 \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.execute_or_create_resource(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param str resource_function: This value is not needed. Most of the time resources do not accept a function but they have their own functions predefined. You can use this to trigger them. If a function is included, the body of this request is passed as a char* to the function in Device Management Client.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
'''
pass
def execute_or_create_resource_with_http_info(self, device_id, _resource_path, **kwargs):
'''Execute a function on a Resource or create new Object instance # noqa: E501
With this API, you can [execute a function](/docs/current/connecting/handle-resource-webapp.html#the-execute-operation) on an existing resource and create new Object instance to the device. The resource-path does not have to exist - it can be created by the call. The maximum length of resource-path is 255 characters. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example resets the min and max values of the [temperature sensor](http://www.openmobilealliance.org/tech/profiles/lwm2m/3303.xml) instance 0 by executing the Resource 5605 'Reset Min and Max Measured Values'. curl -X POST \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3303/0/5605 \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.execute_or_create_resource_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param str resource_function: This value is not needed. Most of the time resources do not accept a function but they have their own functions predefined. You can use this to trigger them. If a function is included, the body of this request is passed as a char* to the function in Device Management Client.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_resource_value(self, device_id, _resource_path, **kwargs):
'''Read from a resource # noqa: E501
Requests the resource value and when the response is available, an `AsyncIDResponse` json object is received in the notification channel. The preferred way to get resource values is to use the **subscribe** and **callback** methods. All resource APIs are asynchronous. These APIs only respond if the device is turned on and connected to Device Management. Please refer to [Lightweight Machine to Machine Technical specification](http://www.openmobilealliance.org/release/LightweightM2M/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf) for more inforamtion. **Example usage:** curl -X GET \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_resource_value(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: Unique Device Management device ID for the endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool cache_only: If true, the response comes only from the cache. Default: false. Device Management Connect caches the received resource values for the time of [max_age](/docs/current/connecting/working-with-the-resources.html) defined in the client side.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter `noResp`. If a request is made with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_resource_value_with_http_info(self, device_id, _resource_path, **kwargs):
'''Read from a resource # noqa: E501
Requests the resource value and when the response is available, an `AsyncIDResponse` json object is received in the notification channel. The preferred way to get resource values is to use the **subscribe** and **callback** methods. All resource APIs are asynchronous. These APIs only respond if the device is turned on and connected to Device Management. Please refer to [Lightweight Machine to Machine Technical specification](http://www.openmobilealliance.org/release/LightweightM2M/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf) for more inforamtion. **Example usage:** curl -X GET \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_resource_value_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: Unique Device Management device ID for the endpoint. Note that the ID needs to be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:param bool cache_only: If true, the response comes only from the cache. Default: false. Device Management Connect caches the received resource values for the time of [max_age](/docs/current/connecting/working-with-the-resources.html) defined in the client side.
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter `noResp`. If a request is made with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_resource_value(self, device_id, _resource_path, resource_value, **kwargs):
'''Write to a resource or use write-attributes for a resource # noqa: E501
With this API, you can [write a new value to existing resources](/docs/current/connecting/handle-resource-webapp.html) or [use the write-attributes](/docs/current/connecting/resource-change-webapp.html) for a resource. This API can also be used to transfer files to the device. Device Management Connect LwM2M server implements the Option 1 from RFC7959. The maximum block size is 1024 bytes. The block size versus transferred file size is something to note in low quality networks. The customer application needs to know what type of file is transferred (for example txt) and the payload can be encrypted by the customer. The maximum size of payload is 1048576 bytes. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example sets the alarm on a buzzer. The command writes the [Buzzer](http://www.openmobilealliance.org/tech/profiles/lwm2m/3338.xml) instance 0, "On/Off" boolean resource to '1'. curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3338/0/5850 -H "content-type: text/plain" \ -H 'authorization: Bearer {api-key}' -d '1' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_resource_value(device_id, _resource_path, resource_value, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: Resource URL. (required)
:param str resource_value: The value to be set to the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_resource_value_with_http_info(self, device_id, _resource_path, resource_value, **kwargs):
'''Write to a resource or use write-attributes for a resource # noqa: E501
With this API, you can [write a new value to existing resources](/docs/current/connecting/handle-resource-webapp.html) or [use the write-attributes](/docs/current/connecting/resource-change-webapp.html) for a resource. This API can also be used to transfer files to the device. Device Management Connect LwM2M server implements the Option 1 from RFC7959. The maximum block size is 1024 bytes. The block size versus transferred file size is something to note in low quality networks. The customer application needs to know what type of file is transferred (for example txt) and the payload can be encrypted by the customer. The maximum size of payload is 1048576 bytes. All resource APIs are asynchronous. These APIs respond only if the device is turned on and connected to Device Management Connect and there is an active notification channel. Supported content types depend on the device and its resource. Device Management translates HTTP to equivalent CoAP content type. **Example usage:** This example sets the alarm on a buzzer. The command writes the [Buzzer](http://www.openmobilealliance.org/tech/profiles/lwm2m/3338.xml) instance 0, "On/Off" boolean resource to '1'. curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/endpoints/{device-id}/3338/0/5850 -H "content-type: text/plain" \ -H 'authorization: Bearer {api-key}' -d '1' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_resource_value_with_http_info(device_id, _resource_path, resource_value, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: Resource URL. (required)
:param str resource_value: The value to be set to the resource. (required)
:param bool no_resp: <br/><br/><b>Non-confirmable requests</b><br/> All resource APIs have the parameter noResp. If you make a request with `noResp=true`, Device Management Connect makes a CoAP non-confirmable request to the device. Such requests are not guaranteed to arrive in the device, and you do not get back an async-response-id. If calls with this parameter enabled succeed, they return with the status code `204 No Content`. If the underlying protocol does not support non-confirmable requests, or if the endpoint is registered in queue mode, the response is status code `409 Conflict`.
:return: AsyncID
If the method is called asynchronously,
returns the request thread.
'''
pass
| 10 | 9 | 48 | 6 | 27 | 21 | 5 | 0.78 | 1 | 3 | 1 | 0 | 9 | 1 | 9 | 9 | 447 | 64 | 246 | 59 | 236 | 191 | 163 | 59 | 153 | 10 | 1 | 2 | 46 |
2,581 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/configuration.py
|
mbed_cloud._backends.mds.configuration.Configuration
|
class Configuration(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
"""
def __init__(self):
"""Constructor"""
# Default Base url
self.host = "https://api.us-east-1.mbedcloud.com"
# Temp file folder for downloading files
self.temp_folder_path = None
# Authentication Settings
# dict to store API key(s)
self.api_key = {}
# dict to store API prefix (e.g. Bearer)
self.api_key_prefix = {}
# Username for HTTP basic authentication
self.username = ""
# Password for HTTP basic authentication
self.password = ""
# Logging Settings
self.logger = {}
self.logger["package_logger"] = logging.getLogger("mds")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
# Log format
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
# Log stream handler
self.logger_stream_handler = None
# Log file handler
self.logger_file_handler = None
# Debug file location
self.logger_file = None
# Debug switch
self.debug = False
# SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API
# from https server.
self.verify_ssl = True
# Set this to customize the certificate file to verify the peer.
self.ssl_ca_cert = None
# client certificate file
self.cert_file = None
# client key file
self.key_file = None
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None
# urllib3 connection pool's maximum number of connections saved
# per pool. urllib3 uses 1 connection as default value, but this is
# not the best value when you are making a lot of possibly parallel
# requests to the same host, which is often the case here.
# cpu_count * 5 is used as default value to increase performance.
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# Proxy URL
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler)
else:
# If not set logging file,
# then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if (self.api_key.get(identifier) and
self.api_key_prefix.get(identifier)):
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501
elif self.api_key.get(identifier):
return self.api_key[identifier]
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
return {
'Bearer':
{
'type': 'api_key',
'in': 'header',
'key': 'Authorization',
'value': self.get_api_key_with_prefix('Authorization')
},
}
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 2\n"\
"SDK Package Version: 1.0.0".\
format(env=sys.platform, pyversion=sys.version)
|
class Configuration(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
'''
def __init__(self):
'''Constructor'''
pass
@property
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@logger_file.setter
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@property
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@debug.setter
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@property
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
@logger_format.setter
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
def get_api_key_with_prefix(self, identifier):
'''Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
'''
pass
def get_basic_auth_token(self):
'''Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
'''
pass
def auth_settings(self):
'''Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
'''
pass
def to_debug_report(self):
'''Gets the essential information for debugging.
:return: The report for debugging.
'''
pass
| 18 | 12 | 17 | 2 | 8 | 7 | 2 | 0.92 | 1 | 3 | 0 | 0 | 11 | 21 | 11 | 11 | 208 | 32 | 92 | 41 | 74 | 85 | 67 | 35 | 55 | 6 | 1 | 3 | 21 |
2,582 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/models/campaign_device_metadata.py
|
mbed_cloud._backends.update_service.models.campaign_device_metadata.CampaignDeviceMetadata
|
class CampaignDeviceMetadata(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'campaign': 'str',
'created_at': 'datetime',
'deployment_state': 'str',
'description': 'str',
'device_id': 'str',
'etag': 'str',
'id': 'str',
'mechanism': 'str',
'mechanism_url': 'str',
'name': 'str',
'object': 'str',
'updated_at': 'datetime'
}
attribute_map = {
'campaign': 'campaign',
'created_at': 'created_at',
'deployment_state': 'deployment_state',
'description': 'description',
'device_id': 'device_id',
'etag': 'etag',
'id': 'id',
'mechanism': 'mechanism',
'mechanism_url': 'mechanism_url',
'name': 'name',
'object': 'object',
'updated_at': 'updated_at'
}
def __init__(self, campaign=None, created_at=None, deployment_state=None, description=None, device_id=None, etag=None, id=None, mechanism=None, mechanism_url=None, name=None, object=None, updated_at=None):
"""
CampaignDeviceMetadata - a model defined in Swagger
"""
self._campaign = campaign
self._created_at = created_at
self._deployment_state = deployment_state
self._description = description
self._device_id = device_id
self._etag = etag
self._id = id
self._mechanism = mechanism
self._mechanism_url = mechanism_url
self._name = name
self._object = object
self._updated_at = updated_at
self.discriminator = None
@property
def campaign(self):
"""
Gets the campaign of this CampaignDeviceMetadata.
The device's campaign ID
:return: The campaign of this CampaignDeviceMetadata.
:rtype: str
"""
return self._campaign
@campaign.setter
def campaign(self, campaign):
"""
Sets the campaign of this CampaignDeviceMetadata.
The device's campaign ID
:param campaign: The campaign of this CampaignDeviceMetadata.
:type: str
"""
self._campaign = campaign
@property
def created_at(self):
"""
Gets the created_at of this CampaignDeviceMetadata.
The time the campaign was created
:return: The created_at of this CampaignDeviceMetadata.
:rtype: datetime
"""
return self._created_at
@created_at.setter
def created_at(self, created_at):
"""
Sets the created_at of this CampaignDeviceMetadata.
The time the campaign was created
:param created_at: The created_at of this CampaignDeviceMetadata.
:type: datetime
"""
self._created_at = created_at
@property
def deployment_state(self):
"""
Gets the deployment_state of this CampaignDeviceMetadata.
The state of the update campaign on the device
:return: The deployment_state of this CampaignDeviceMetadata.
:rtype: str
"""
return self._deployment_state
@deployment_state.setter
def deployment_state(self, deployment_state):
"""
Sets the deployment_state of this CampaignDeviceMetadata.
The state of the update campaign on the device
:param deployment_state: The deployment_state of this CampaignDeviceMetadata.
:type: str
"""
allowed_values = ["pending", "updated_connector_channel", "failed_connector_channel_update", "deployed", "manifestremoved", "deregistered"]
if deployment_state not in allowed_values:
raise ValueError(
"Invalid value for `deployment_state` ({0}), must be one of {1}"
.format(deployment_state, allowed_values)
)
self._deployment_state = deployment_state
@property
def description(self):
"""
Gets the description of this CampaignDeviceMetadata.
Description
:return: The description of this CampaignDeviceMetadata.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this CampaignDeviceMetadata.
Description
:param description: The description of this CampaignDeviceMetadata.
:type: str
"""
if description is not None and len(description) > 2000:
raise ValueError("Invalid value for `description`, length must be less than or equal to `2000`")
self._description = description
@property
def device_id(self):
"""
Gets the device_id of this CampaignDeviceMetadata.
The device ID
:return: The device_id of this CampaignDeviceMetadata.
:rtype: str
"""
return self._device_id
@device_id.setter
def device_id(self, device_id):
"""
Sets the device_id of this CampaignDeviceMetadata.
The device ID
:param device_id: The device_id of this CampaignDeviceMetadata.
:type: str
"""
self._device_id = device_id
@property
def etag(self):
"""
Gets the etag of this CampaignDeviceMetadata.
API resource entity version
:return: The etag of this CampaignDeviceMetadata.
:rtype: str
"""
return self._etag
@etag.setter
def etag(self, etag):
"""
Sets the etag of this CampaignDeviceMetadata.
API resource entity version
:param etag: The etag of this CampaignDeviceMetadata.
:type: str
"""
self._etag = etag
@property
def id(self):
"""
Gets the id of this CampaignDeviceMetadata.
The metadata record ID
:return: The id of this CampaignDeviceMetadata.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this CampaignDeviceMetadata.
The metadata record ID
:param id: The id of this CampaignDeviceMetadata.
:type: str
"""
self._id = id
@property
def mechanism(self):
"""
Gets the mechanism of this CampaignDeviceMetadata.
How the firmware is delivered (connector or direct)
:return: The mechanism of this CampaignDeviceMetadata.
:rtype: str
"""
return self._mechanism
@mechanism.setter
def mechanism(self, mechanism):
"""
Sets the mechanism of this CampaignDeviceMetadata.
How the firmware is delivered (connector or direct)
:param mechanism: The mechanism of this CampaignDeviceMetadata.
:type: str
"""
self._mechanism = mechanism
@property
def mechanism_url(self):
"""
Gets the mechanism_url of this CampaignDeviceMetadata.
The Device Management Connect URL
:return: The mechanism_url of this CampaignDeviceMetadata.
:rtype: str
"""
return self._mechanism_url
@mechanism_url.setter
def mechanism_url(self, mechanism_url):
"""
Sets the mechanism_url of this CampaignDeviceMetadata.
The Device Management Connect URL
:param mechanism_url: The mechanism_url of this CampaignDeviceMetadata.
:type: str
"""
self._mechanism_url = mechanism_url
@property
def name(self):
"""
Gets the name of this CampaignDeviceMetadata.
The record name
:return: The name of this CampaignDeviceMetadata.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this CampaignDeviceMetadata.
The record name
:param name: The name of this CampaignDeviceMetadata.
:type: str
"""
if name is not None and len(name) > 128:
raise ValueError("Invalid value for `name`, length must be less than or equal to `128`")
self._name = name
@property
def object(self):
"""
Gets the object of this CampaignDeviceMetadata.
The entity name: always 'update-campaign-device-metadata'
:return: The object of this CampaignDeviceMetadata.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this CampaignDeviceMetadata.
The entity name: always 'update-campaign-device-metadata'
:param object: The object of this CampaignDeviceMetadata.
:type: str
"""
self._object = object
@property
def updated_at(self):
"""
Gets the updated_at of this CampaignDeviceMetadata.
The record was modified in the database format: date-time
:return: The updated_at of this CampaignDeviceMetadata.
:rtype: datetime
"""
return self._updated_at
@updated_at.setter
def updated_at(self, updated_at):
"""
Sets the updated_at of this CampaignDeviceMetadata.
The record was modified in the database format: date-time
:param updated_at: The updated_at of this CampaignDeviceMetadata.
:type: datetime
"""
self._updated_at = updated_at
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, CampaignDeviceMetadata):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class CampaignDeviceMetadata(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, campaign=None, created_at=None, deployment_state=None, description=None, device_id=None, etag=None, id=None, mechanism=None, mechanism_url=None, name=None, object=None, updated_at=None):
'''
CampaignDeviceMetadata - a model defined in Swagger
'''
pass
@property
def campaign(self):
'''
Gets the campaign of this CampaignDeviceMetadata.
The device's campaign ID
:return: The campaign of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@campaign.setter
def campaign(self):
'''
Sets the campaign of this CampaignDeviceMetadata.
The device's campaign ID
:param campaign: The campaign of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def created_at(self):
'''
Gets the created_at of this CampaignDeviceMetadata.
The time the campaign was created
:return: The created_at of this CampaignDeviceMetadata.
:rtype: datetime
'''
pass
@created_at.setter
def created_at(self):
'''
Sets the created_at of this CampaignDeviceMetadata.
The time the campaign was created
:param created_at: The created_at of this CampaignDeviceMetadata.
:type: datetime
'''
pass
@property
def deployment_state(self):
'''
Gets the deployment_state of this CampaignDeviceMetadata.
The state of the update campaign on the device
:return: The deployment_state of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@deployment_state.setter
def deployment_state(self):
'''
Sets the deployment_state of this CampaignDeviceMetadata.
The state of the update campaign on the device
:param deployment_state: The deployment_state of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def description(self):
'''
Gets the description of this CampaignDeviceMetadata.
Description
:return: The description of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@description.setter
def description(self):
'''
Sets the description of this CampaignDeviceMetadata.
Description
:param description: The description of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def device_id(self):
'''
Gets the device_id of this CampaignDeviceMetadata.
The device ID
:return: The device_id of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@device_id.setter
def device_id(self):
'''
Sets the device_id of this CampaignDeviceMetadata.
The device ID
:param device_id: The device_id of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def etag(self):
'''
Gets the etag of this CampaignDeviceMetadata.
API resource entity version
:return: The etag of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@etag.setter
def etag(self):
'''
Sets the etag of this CampaignDeviceMetadata.
API resource entity version
:param etag: The etag of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def id(self):
'''
Gets the id of this CampaignDeviceMetadata.
The metadata record ID
:return: The id of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this CampaignDeviceMetadata.
The metadata record ID
:param id: The id of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def mechanism(self):
'''
Gets the mechanism of this CampaignDeviceMetadata.
How the firmware is delivered (connector or direct)
:return: The mechanism of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@mechanism.setter
def mechanism(self):
'''
Sets the mechanism of this CampaignDeviceMetadata.
How the firmware is delivered (connector or direct)
:param mechanism: The mechanism of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def mechanism_url(self):
'''
Gets the mechanism_url of this CampaignDeviceMetadata.
The Device Management Connect URL
:return: The mechanism_url of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@mechanism_url.setter
def mechanism_url(self):
'''
Sets the mechanism_url of this CampaignDeviceMetadata.
The Device Management Connect URL
:param mechanism_url: The mechanism_url of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this CampaignDeviceMetadata.
The record name
:return: The name of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this CampaignDeviceMetadata.
The record name
:param name: The name of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this CampaignDeviceMetadata.
The entity name: always 'update-campaign-device-metadata'
:return: The object of this CampaignDeviceMetadata.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this CampaignDeviceMetadata.
The entity name: always 'update-campaign-device-metadata'
:param object: The object of this CampaignDeviceMetadata.
:type: str
'''
pass
@property
def updated_at(self):
'''
Gets the updated_at of this CampaignDeviceMetadata.
The record was modified in the database format: date-time
:return: The updated_at of this CampaignDeviceMetadata.
:rtype: datetime
'''
pass
@updated_at.setter
def updated_at(self):
'''
Sets the updated_at of this CampaignDeviceMetadata.
The record was modified in the database format: date-time
:param updated_at: The updated_at of this CampaignDeviceMetadata.
:type: datetime
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 55 | 31 | 10 | 1 | 3 | 5 | 1 | 1.12 | 1 | 4 | 0 | 0 | 30 | 13 | 30 | 30 | 401 | 73 | 155 | 74 | 100 | 173 | 92 | 50 | 61 | 5 | 1 | 2 | 38 |
2,583 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/configuration.py
|
mbed_cloud._backends.update_service.configuration.Configuration
|
class Configuration(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
"""
def __init__(self):
"""Constructor"""
# Default Base url
self.host = "https://api.us-east-1.mbedcloud.com"
# Temp file folder for downloading files
self.temp_folder_path = None
# Authentication Settings
# dict to store API key(s)
self.api_key = {}
# dict to store API prefix (e.g. Bearer)
self.api_key_prefix = {}
# Username for HTTP basic authentication
self.username = ""
# Password for HTTP basic authentication
self.password = ""
# Logging Settings
self.logger = {}
self.logger["package_logger"] = logging.getLogger("update_service")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
# Log format
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
# Log stream handler
self.logger_stream_handler = None
# Log file handler
self.logger_file_handler = None
# Debug file location
self.logger_file = None
# Debug switch
self.debug = False
# SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API
# from https server.
self.verify_ssl = True
# Set this to customize the certificate file to verify the peer.
self.ssl_ca_cert = None
# client certificate file
self.cert_file = None
# client key file
self.key_file = None
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None
# urllib3 connection pool's maximum number of connections saved
# per pool. urllib3 uses 1 connection as default value, but this is
# not the best value when you are making a lot of possibly parallel
# requests to the same host, which is often the case here.
# cpu_count * 5 is used as default value to increase performance.
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# Proxy URL
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler)
else:
# If not set logging file,
# then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if (self.api_key.get(identifier) and
self.api_key_prefix.get(identifier)):
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501
elif self.api_key.get(identifier):
return self.api_key[identifier]
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
return {
'Bearer':
{
'type': 'api_key',
'in': 'header',
'key': 'Authorization',
'value': self.get_api_key_with_prefix('Authorization')
},
}
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 3\n"\
"SDK Package Version: 1.0.0".\
format(env=sys.platform, pyversion=sys.version)
|
class Configuration(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
'''
def __init__(self):
'''Constructor'''
pass
@property
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@logger_file.setter
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@property
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@debug.setter
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@property
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
@logger_format.setter
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
def get_api_key_with_prefix(self, identifier):
'''Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
'''
pass
def get_basic_auth_token(self):
'''Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
'''
pass
def auth_settings(self):
'''Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
'''
pass
def to_debug_report(self):
'''Gets the essential information for debugging.
:return: The report for debugging.
'''
pass
| 18 | 12 | 17 | 2 | 8 | 7 | 2 | 0.92 | 1 | 3 | 0 | 0 | 11 | 21 | 11 | 11 | 208 | 32 | 92 | 41 | 74 | 85 | 67 | 35 | 55 | 6 | 1 | 3 | 21 |
2,584 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/update_service/apis/default_api.py
|
mbed_cloud._backends.update_service.apis.default_api.DefaultApi
|
class DefaultApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def firmware_image_create(self, datafile, name, **kwargs): # noqa: E501
"""Create an image # noqa: E501
Create a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_create(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The firmware image file to upload (required)
:param str name: The name of the firmware image (required)
:param str description: The description of the firmware image
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_image_create_with_http_info(datafile, name, **kwargs) # noqa: E501
else:
(data) = self.firmware_image_create_with_http_info(datafile, name, **kwargs) # noqa: E501
return data
def firmware_image_create_with_http_info(self, datafile, name, **kwargs): # noqa: E501
"""Create an image # noqa: E501
Create a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_create_with_http_info(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The firmware image file to upload (required)
:param str name: The name of the firmware image (required)
:param str description: The description of the firmware image
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['datafile', 'name', 'description'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_image_create" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'datafile' is set
if ('datafile' not in params or
params['datafile'] is None):
raise ValueError("Missing the required parameter `datafile` when calling `firmware_image_create`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `firmware_image_create`") # noqa: E501
if ('name' in params and
len(params['name']) > 128):
raise ValueError("Invalid value for parameter `name` when calling `firmware_image_create`, length must be less than or equal to `128`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
if 'datafile' in params:
local_var_files['datafile'] = params['datafile'] # noqa: E501
if 'description' in params:
form_params.append(('description', params['description'])) # noqa: E501
if 'name' in params:
form_params.append(('name', params['name'])) # noqa: E501
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['multipart/form-data']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='FirmwareImage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def firmware_image_destroy(self, image_id, **kwargs): # noqa: E501
"""Delete an image # noqa: E501
Delete a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_destroy(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_image_destroy_with_http_info(image_id, **kwargs) # noqa: E501
else:
(data) = self.firmware_image_destroy_with_http_info(image_id, **kwargs) # noqa: E501
return data
def firmware_image_destroy_with_http_info(self, image_id, **kwargs): # noqa: E501
"""Delete an image # noqa: E501
Delete a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_destroy_with_http_info(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['image_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_image_destroy" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'image_id' is set
if ('image_id' not in params or
params['image_id'] is None):
raise ValueError("Missing the required parameter `image_id` when calling `firmware_image_destroy`") # noqa: E501
collection_formats = {}
path_params = {}
if 'image_id' in params:
path_params['image_id'] = params['image_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/{image_id}/', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def firmware_image_list(self, **kwargs): # noqa: E501
"""List all images # noqa: E501
List all firmware images. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware images to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_checksum</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: FirmwareImagePage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_image_list_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.firmware_image_list_with_http_info(**kwargs) # noqa: E501
return data
def firmware_image_list_with_http_info(self, **kwargs): # noqa: E501
"""List all images # noqa: E501
List all firmware images. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware images to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_checksum</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: FirmwareImagePage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['limit', 'order', 'after', 'include', 'filter'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_image_list" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
if 'filter' in params:
query_params.append(('filter', params['filter'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='FirmwareImagePage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def firmware_image_retrieve(self, image_id, **kwargs): # noqa: E501
"""Get an image # noqa: E501
Retrieve a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_retrieve(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_image_retrieve_with_http_info(image_id, **kwargs) # noqa: E501
else:
(data) = self.firmware_image_retrieve_with_http_info(image_id, **kwargs) # noqa: E501
return data
def firmware_image_retrieve_with_http_info(self, image_id, **kwargs): # noqa: E501
"""Get an image # noqa: E501
Retrieve a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_retrieve_with_http_info(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['image_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_image_retrieve" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'image_id' is set
if ('image_id' not in params or
params['image_id'] is None):
raise ValueError("Missing the required parameter `image_id` when calling `firmware_image_retrieve`") # noqa: E501
collection_formats = {}
path_params = {}
if 'image_id' in params:
path_params['image_id'] = params['image_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/{image_id}/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='FirmwareImage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def firmware_manifest_create(self, datafile, name, **kwargs): # noqa: E501
"""Create a manifest # noqa: E501
Create a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_create(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The manifest file to create. The API gateway enforces the account-specific file size. (required)
:param str name: The name of the firmware manifest (required)
:param str description: The description of the firmware manifest
:param file key_table: The key table of pre-shared keys for devices
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_manifest_create_with_http_info(datafile, name, **kwargs) # noqa: E501
else:
(data) = self.firmware_manifest_create_with_http_info(datafile, name, **kwargs) # noqa: E501
return data
def firmware_manifest_create_with_http_info(self, datafile, name, **kwargs): # noqa: E501
"""Create a manifest # noqa: E501
Create a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_create_with_http_info(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The manifest file to create. The API gateway enforces the account-specific file size. (required)
:param str name: The name of the firmware manifest (required)
:param str description: The description of the firmware manifest
:param file key_table: The key table of pre-shared keys for devices
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['datafile', 'name', 'description', 'key_table'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_manifest_create" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'datafile' is set
if ('datafile' not in params or
params['datafile'] is None):
raise ValueError("Missing the required parameter `datafile` when calling `firmware_manifest_create`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `firmware_manifest_create`") # noqa: E501
if ('name' in params and
len(params['name']) > 128):
raise ValueError("Invalid value for parameter `name` when calling `firmware_manifest_create`, length must be less than or equal to `128`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
if 'datafile' in params:
local_var_files['datafile'] = params['datafile'] # noqa: E501
if 'description' in params:
form_params.append(('description', params['description'])) # noqa: E501
if 'key_table' in params:
local_var_files['key_table'] = params['key_table'] # noqa: E501
if 'name' in params:
form_params.append(('name', params['name'])) # noqa: E501
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['multipart/form-data']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-manifests/', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='FirmwareManifest', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def firmware_manifest_destroy(self, manifest_id, **kwargs): # noqa: E501
"""Delete a manifest # noqa: E501
Delete a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_destroy(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_manifest_destroy_with_http_info(manifest_id, **kwargs) # noqa: E501
else:
(data) = self.firmware_manifest_destroy_with_http_info(manifest_id, **kwargs) # noqa: E501
return data
def firmware_manifest_destroy_with_http_info(self, manifest_id, **kwargs): # noqa: E501
"""Delete a manifest # noqa: E501
Delete a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_destroy_with_http_info(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['manifest_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_manifest_destroy" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'manifest_id' is set
if ('manifest_id' not in params or
params['manifest_id'] is None):
raise ValueError("Missing the required parameter `manifest_id` when calling `firmware_manifest_destroy`") # noqa: E501
collection_formats = {}
path_params = {}
if 'manifest_id' in params:
path_params['manifest_id'] = params['manifest_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-manifests/{manifest_id}/', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def firmware_manifest_list(self, **kwargs): # noqa: E501
"""List manifests # noqa: E501
List firmware manifests. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware manifests to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_class</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=mymanifest` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=mymanifest&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-manifest1,fw-manifest2`
:return: FirmwareManifestPage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_manifest_list_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.firmware_manifest_list_with_http_info(**kwargs) # noqa: E501
return data
def firmware_manifest_list_with_http_info(self, **kwargs): # noqa: E501
"""List manifests # noqa: E501
List firmware manifests. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware manifests to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_class</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=mymanifest` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=mymanifest&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-manifest1,fw-manifest2`
:return: FirmwareManifestPage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['limit', 'order', 'after', 'include', 'filter'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_manifest_list" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
if 'filter' in params:
query_params.append(('filter', params['filter'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-manifests/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='FirmwareManifestPage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def firmware_manifest_retrieve(self, manifest_id, **kwargs): # noqa: E501
"""Get a manifest # noqa: E501
Retrieve a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_retrieve(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.firmware_manifest_retrieve_with_http_info(manifest_id, **kwargs) # noqa: E501
else:
(data) = self.firmware_manifest_retrieve_with_http_info(manifest_id, **kwargs) # noqa: E501
return data
def firmware_manifest_retrieve_with_http_info(self, manifest_id, **kwargs): # noqa: E501
"""Get a manifest # noqa: E501
Retrieve a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_retrieve_with_http_info(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['manifest_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method firmware_manifest_retrieve" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'manifest_id' is set
if ('manifest_id' not in params or
params['manifest_id'] is None):
raise ValueError("Missing the required parameter `manifest_id` when calling `firmware_manifest_retrieve`") # noqa: E501
collection_formats = {}
path_params = {}
if 'manifest_id' in params:
path_params['manifest_id'] = params['manifest_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-manifests/{manifest_id}/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='FirmwareManifest', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_archive(self, campaign_id, **kwargs): # noqa: E501
"""Archive a campaign. # noqa: E501
This command will archive a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_archive(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_archive_with_http_info(campaign_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_archive_with_http_info(campaign_id, **kwargs) # noqa: E501
return data
def update_campaign_archive_with_http_info(self, campaign_id, **kwargs): # noqa: E501
"""Archive a campaign. # noqa: E501
This command will archive a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_archive_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_archive" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_archive`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/archive', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_create(self, campaign, **kwargs): # noqa: E501
"""Create a campaign # noqa: E501
Create an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_create(campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UpdateCampaignPostRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_create_with_http_info(campaign, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_create_with_http_info(campaign, **kwargs) # noqa: E501
return data
def update_campaign_create_with_http_info(self, campaign, **kwargs): # noqa: E501
"""Create a campaign # noqa: E501
Create an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_create_with_http_info(campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UpdateCampaignPostRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_create" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign' is set
if ('campaign' not in params or
params['campaign'] is None):
raise ValueError("Missing the required parameter `campaign` when calling `update_campaign_create`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'campaign' in params:
body_params = params['campaign']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UpdateCampaign', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_destroy(self, campaign_id, **kwargs): # noqa: E501
"""Delete a campaign # noqa: E501
Delete an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_destroy(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The ID of the update campaign (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_destroy_with_http_info(campaign_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_destroy_with_http_info(campaign_id, **kwargs) # noqa: E501
return data
def update_campaign_destroy_with_http_info(self, campaign_id, **kwargs): # noqa: E501
"""Delete a campaign # noqa: E501
Delete an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_destroy_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The ID of the update campaign (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_destroy" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_destroy`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_list(self, **kwargs): # noqa: E501
"""List all campaigns # noqa: E501
Get update campaigns for devices specified by a filter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many update campaigns to retrieve
:param str order: The order of the records. Acceptable values: ASC, DESC. Default: ASC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The below table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_filter</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>finished</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>root_manifest_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>started_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>state</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>when</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by campaign properties** `state__eq=[draft|scheduled|devicefectch|devicecopy|publishing|deploying|deployed|manifestremoved|expired]` `root_manifest_id__eq=43217771234242e594ddb433816c498a` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `state__eq=deployed&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UpdateCampaignPage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_list_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.update_campaign_list_with_http_info(**kwargs) # noqa: E501
return data
def update_campaign_list_with_http_info(self, **kwargs): # noqa: E501
"""List all campaigns # noqa: E501
Get update campaigns for devices specified by a filter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many update campaigns to retrieve
:param str order: The order of the records. Acceptable values: ASC, DESC. Default: ASC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The below table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_filter</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>finished</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>root_manifest_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>started_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>state</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>when</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by campaign properties** `state__eq=[draft|scheduled|devicefectch|devicecopy|publishing|deploying|deployed|manifestremoved|expired]` `root_manifest_id__eq=43217771234242e594ddb433816c498a` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `state__eq=deployed&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UpdateCampaignPage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['limit', 'order', 'after', 'include', 'filter'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_list" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
if 'filter' in params:
query_params.append(('filter', params['filter'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UpdateCampaignPage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_metadata_list(self, campaign_id, **kwargs): # noqa: E501
"""List all campaign device metadata # noqa: E501
Get campaign device metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_list(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param int limit: How many objects to retrieve in the page
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:return: CampaignDeviceMetadataPage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_metadata_list_with_http_info(campaign_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_metadata_list_with_http_info(campaign_id, **kwargs) # noqa: E501
return data
def update_campaign_metadata_list_with_http_info(self, campaign_id, **kwargs): # noqa: E501
"""List all campaign device metadata # noqa: E501
Get campaign device metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_list_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param int limit: How many objects to retrieve in the page
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:return: CampaignDeviceMetadataPage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id', 'limit', 'order', 'after', 'include'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_metadata_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_metadata_list`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/campaign-device-metadata/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CampaignDeviceMetadataPage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_metadata_retrieve(self, campaign_id, campaign_device_metadata_id, **kwargs): # noqa: E501
"""Get a campaign device metadata # noqa: E501
Get update campaign metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_retrieve(campaign_id, campaign_device_metadata_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param str campaign_device_metadata_id: The campaign device metadata ID (required)
:return: CampaignDeviceMetadata
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_metadata_retrieve_with_http_info(campaign_id, campaign_device_metadata_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_metadata_retrieve_with_http_info(campaign_id, campaign_device_metadata_id, **kwargs) # noqa: E501
return data
def update_campaign_metadata_retrieve_with_http_info(self, campaign_id, campaign_device_metadata_id, **kwargs): # noqa: E501
"""Get a campaign device metadata # noqa: E501
Get update campaign metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_retrieve_with_http_info(campaign_id, campaign_device_metadata_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param str campaign_device_metadata_id: The campaign device metadata ID (required)
:return: CampaignDeviceMetadata
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id', 'campaign_device_metadata_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_metadata_retrieve" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_metadata_retrieve`") # noqa: E501
# verify the required parameter 'campaign_device_metadata_id' is set
if ('campaign_device_metadata_id' not in params or
params['campaign_device_metadata_id'] is None):
raise ValueError("Missing the required parameter `campaign_device_metadata_id` when calling `update_campaign_metadata_retrieve`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
if 'campaign_device_metadata_id' in params:
path_params['campaign_device_metadata_id'] = params['campaign_device_metadata_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/campaign-device-metadata/{campaign_device_metadata_id}/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CampaignDeviceMetadata', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_metrics(self, campaign_id, **kwargs): # noqa: E501
"""Get campaign metrics # noqa: E501
Get detailed statistics of a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metrics(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: CampaignMetrics
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_metrics_with_http_info(campaign_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_metrics_with_http_info(campaign_id, **kwargs) # noqa: E501
return data
def update_campaign_metrics_with_http_info(self, campaign_id, **kwargs): # noqa: E501
"""Get campaign metrics # noqa: E501
Get detailed statistics of a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metrics_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: CampaignMetrics
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_metrics" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_metrics`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/metrics', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='CampaignMetrics', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_retrieve(self, campaign_id, **kwargs): # noqa: E501
"""Get a campaign. # noqa: E501
Get an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_retrieve(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_retrieve_with_http_info(campaign_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_retrieve_with_http_info(campaign_id, **kwargs) # noqa: E501
return data
def update_campaign_retrieve_with_http_info(self, campaign_id, **kwargs): # noqa: E501
"""Get a campaign. # noqa: E501
Get an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_retrieve_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_retrieve" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_retrieve`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UpdateCampaign', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_start(self, campaign_id, **kwargs): # noqa: E501
"""Start a campaign. # noqa: E501
This command will begin the process of starting a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_start(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_start_with_http_info(campaign_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_start_with_http_info(campaign_id, **kwargs) # noqa: E501
return data
def update_campaign_start_with_http_info(self, campaign_id, **kwargs): # noqa: E501
"""Start a campaign. # noqa: E501
This command will begin the process of starting a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_start_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_start" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_start`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/start', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_stop(self, campaign_id, **kwargs): # noqa: E501
"""Stop a campaign. # noqa: E501
This command will begin the process of stopping a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_stop(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_stop_with_http_info(campaign_id, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_stop_with_http_info(campaign_id, **kwargs) # noqa: E501
return data
def update_campaign_stop_with_http_info(self, campaign_id, **kwargs): # noqa: E501
"""Stop a campaign. # noqa: E501
This command will begin the process of stopping a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_stop_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_stop" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_stop`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/stop', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_campaign_update(self, campaign_id, campaign, **kwargs): # noqa: E501
"""Modify a campaign # noqa: E501
Modify an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_update(campaign_id, campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: (required)
:param UpdateCampaignPutRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_campaign_update_with_http_info(campaign_id, campaign, **kwargs) # noqa: E501
else:
(data) = self.update_campaign_update_with_http_info(campaign_id, campaign, **kwargs) # noqa: E501
return data
def update_campaign_update_with_http_info(self, campaign_id, campaign, **kwargs): # noqa: E501
"""Modify a campaign # noqa: E501
Modify an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_update_with_http_info(campaign_id, campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: (required)
:param UpdateCampaignPutRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['campaign_id', 'campaign'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_campaign_update" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'campaign_id' is set
if ('campaign_id' not in params or
params['campaign_id'] is None):
raise ValueError("Missing the required parameter `campaign_id` when calling `update_campaign_update`") # noqa: E501
# verify the required parameter 'campaign' is set
if ('campaign' not in params or
params['campaign'] is None):
raise ValueError("Missing the required parameter `campaign` when calling `update_campaign_update`") # noqa: E501
collection_formats = {}
path_params = {}
if 'campaign_id' in params:
path_params['campaign_id'] = params['campaign_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'campaign' in params:
body_params = params['campaign']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/update-campaigns/{campaign_id}/', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UpdateCampaign', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_chunk_create(self, content_length, upload_job_id, **kwargs): # noqa: E501
"""Append a chunks to an upload job # noqa: E501
Append a chunks to an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_create(content_length, upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int content_length: (required)
:param str upload_job_id: Upload job ID (required)
:param str content_md5:
:param str chunk: Chunk
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_chunk_create_with_http_info(content_length, upload_job_id, **kwargs) # noqa: E501
else:
(data) = self.upload_job_chunk_create_with_http_info(content_length, upload_job_id, **kwargs) # noqa: E501
return data
def upload_job_chunk_create_with_http_info(self, content_length, upload_job_id, **kwargs): # noqa: E501
"""Append a chunks to an upload job # noqa: E501
Append a chunks to an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_create_with_http_info(content_length, upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int content_length: (required)
:param str upload_job_id: Upload job ID (required)
:param str content_md5:
:param str chunk: Chunk
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['content_length', 'upload_job_id', 'content_md5', 'chunk'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_chunk_create" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'content_length' is set
if ('content_length' not in params or
params['content_length'] is None):
raise ValueError("Missing the required parameter `content_length` when calling `upload_job_chunk_create`") # noqa: E501
# verify the required parameter 'upload_job_id' is set
if ('upload_job_id' not in params or
params['upload_job_id'] is None):
raise ValueError("Missing the required parameter `upload_job_id` when calling `upload_job_chunk_create`") # noqa: E501
collection_formats = {}
path_params = {}
if 'upload_job_id' in params:
path_params['upload_job_id'] = params['upload_job_id'] # noqa: E501
query_params = []
header_params = {}
if 'content_md5' in params:
header_params['Content-MD5'] = params['content_md5'] # noqa: E501
if 'content_length' in params:
header_params['Content-Length'] = params['content_length'] # noqa: E501
form_params = []
local_var_files = {}
body_params = None
if 'chunk' in params:
body_params = params['chunk']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['binary/octet-stream']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs/{upload_job_id}/chunks', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UploadChunkInfo', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_chunk_list(self, upload_job_id, **kwargs): # noqa: E501
"""List all metadata for uploaded chunks # noqa: E501
List all metadata for uploaded chunks # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_list(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param int limit: How many metadata items for uploaded chunks to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>hash</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>length</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `status__eq=in_progress` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `status__eq=in_progress&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `status__in=in_progress,success`
:return: UploadChunkInfoPage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_chunk_list_with_http_info(upload_job_id, **kwargs) # noqa: E501
else:
(data) = self.upload_job_chunk_list_with_http_info(upload_job_id, **kwargs) # noqa: E501
return data
def upload_job_chunk_list_with_http_info(self, upload_job_id, **kwargs): # noqa: E501
"""List all metadata for uploaded chunks # noqa: E501
List all metadata for uploaded chunks # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_list_with_http_info(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param int limit: How many metadata items for uploaded chunks to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>hash</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>length</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `status__eq=in_progress` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `status__eq=in_progress&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `status__in=in_progress,success`
:return: UploadChunkInfoPage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['upload_job_id', 'limit', 'order', 'after', 'include', 'filter'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_chunk_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'upload_job_id' is set
if ('upload_job_id' not in params or
params['upload_job_id'] is None):
raise ValueError("Missing the required parameter `upload_job_id` when calling `upload_job_chunk_list`") # noqa: E501
collection_formats = {}
path_params = {}
if 'upload_job_id' in params:
path_params['upload_job_id'] = params['upload_job_id'] # noqa: E501
query_params = []
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
if 'filter' in params:
query_params.append(('filter', params['filter'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs/{upload_job_id}/chunks', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UploadChunkInfoPage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_chunk_retreive(self, upload_job_id, chunk_id, **kwargs): # noqa: E501
"""Get metadata about a chunk # noqa: E501
Get metadata about a chunk # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_retreive(upload_job_id, chunk_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param str chunk_id: Chunk (required)
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_chunk_retreive_with_http_info(upload_job_id, chunk_id, **kwargs) # noqa: E501
else:
(data) = self.upload_job_chunk_retreive_with_http_info(upload_job_id, chunk_id, **kwargs) # noqa: E501
return data
def upload_job_chunk_retreive_with_http_info(self, upload_job_id, chunk_id, **kwargs): # noqa: E501
"""Get metadata about a chunk # noqa: E501
Get metadata about a chunk # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_retreive_with_http_info(upload_job_id, chunk_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param str chunk_id: Chunk (required)
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['upload_job_id', 'chunk_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_chunk_retreive" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'upload_job_id' is set
if ('upload_job_id' not in params or
params['upload_job_id'] is None):
raise ValueError("Missing the required parameter `upload_job_id` when calling `upload_job_chunk_retreive`") # noqa: E501
# verify the required parameter 'chunk_id' is set
if ('chunk_id' not in params or
params['chunk_id'] is None):
raise ValueError("Missing the required parameter `chunk_id` when calling `upload_job_chunk_retreive`") # noqa: E501
collection_formats = {}
path_params = {}
if 'upload_job_id' in params:
path_params['upload_job_id'] = params['upload_job_id'] # noqa: E501
if 'chunk_id' in params:
path_params['chunk_id'] = params['chunk_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs/{upload_job_id}/chunks/{chunk_id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UploadChunkInfo', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_create(self, upload_job, **kwargs): # noqa: E501
"""Create a new upload job # noqa: E501
Create a new upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_create(upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UploadJob upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_create_with_http_info(upload_job, **kwargs) # noqa: E501
else:
(data) = self.upload_job_create_with_http_info(upload_job, **kwargs) # noqa: E501
return data
def upload_job_create_with_http_info(self, upload_job, **kwargs): # noqa: E501
"""Create a new upload job # noqa: E501
Create a new upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_create_with_http_info(upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UploadJob upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['upload_job'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_create" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'upload_job' is set
if ('upload_job' not in params or
params['upload_job'] is None):
raise ValueError("Missing the required parameter `upload_job` when calling `upload_job_create`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'upload_job' in params:
body_params = params['upload_job']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UploadJob', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_delete(self, upload_job_id, **kwargs): # noqa: E501
"""Delete an upload job # noqa: E501
Delete an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_delete(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_delete_with_http_info(upload_job_id, **kwargs) # noqa: E501
else:
(data) = self.upload_job_delete_with_http_info(upload_job_id, **kwargs) # noqa: E501
return data
def upload_job_delete_with_http_info(self, upload_job_id, **kwargs): # noqa: E501
"""Delete an upload job # noqa: E501
Delete an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_delete_with_http_info(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['upload_job_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'upload_job_id' is set
if ('upload_job_id' not in params or
params['upload_job_id'] is None):
raise ValueError("Missing the required parameter `upload_job_id` when calling `upload_job_delete`") # noqa: E501
collection_formats = {}
path_params = {}
if 'upload_job_id' in params:
path_params['upload_job_id'] = params['upload_job_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs/{upload_job_id}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_list(self, **kwargs): # noqa: E501
"""Get all upload jobs # noqa: E501
Get all upload jobs # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many upload jobs to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>complete</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>firmware_image_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UploadJobPage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_list_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.upload_job_list_with_http_info(**kwargs) # noqa: E501
return data
def upload_job_list_with_http_info(self, **kwargs): # noqa: E501
"""Get all upload jobs # noqa: E501
Get all upload jobs # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many upload jobs to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>complete</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>firmware_image_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UploadJobPage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['limit', 'order', 'after', 'include', 'filter'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_list" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
if 'filter' in params:
query_params.append(('filter', params['filter'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UploadJobPage', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_retrieve(self, upload_job_id, **kwargs): # noqa: E501
"""Get an upload job # noqa: E501
Get an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_retrieve(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_retrieve_with_http_info(upload_job_id, **kwargs) # noqa: E501
else:
(data) = self.upload_job_retrieve_with_http_info(upload_job_id, **kwargs) # noqa: E501
return data
def upload_job_retrieve_with_http_info(self, upload_job_id, **kwargs): # noqa: E501
"""Get an upload job # noqa: E501
Get an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_retrieve_with_http_info(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['upload_job_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_retrieve" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'upload_job_id' is set
if ('upload_job_id' not in params or
params['upload_job_id'] is None):
raise ValueError("Missing the required parameter `upload_job_id` when calling `upload_job_retrieve`") # noqa: E501
collection_formats = {}
path_params = {}
if 'upload_job_id' in params:
path_params['upload_job_id'] = params['upload_job_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs/{upload_job_id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UploadJob', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def upload_job_update(self, upload_job_id, upload_job, **kwargs): # noqa: E501
"""Update an upload job # noqa: E501
Update an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_update(upload_job_id, upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job id (required)
:param UploadJob1 upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.upload_job_update_with_http_info(upload_job_id, upload_job, **kwargs) # noqa: E501
else:
(data) = self.upload_job_update_with_http_info(upload_job_id, upload_job, **kwargs) # noqa: E501
return data
def upload_job_update_with_http_info(self, upload_job_id, upload_job, **kwargs): # noqa: E501
"""Update an upload job # noqa: E501
Update an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_update_with_http_info(upload_job_id, upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job id (required)
:param UploadJob1 upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['upload_job_id', 'upload_job'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method upload_job_update" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'upload_job_id' is set
if ('upload_job_id' not in params or
params['upload_job_id'] is None):
raise ValueError("Missing the required parameter `upload_job_id` when calling `upload_job_update`") # noqa: E501
# verify the required parameter 'upload_job' is set
if ('upload_job' not in params or
params['upload_job'] is None):
raise ValueError("Missing the required parameter `upload_job` when calling `upload_job_update`") # noqa: E501
collection_formats = {}
path_params = {}
if 'upload_job_id' in params:
path_params['upload_job_id'] = params['upload_job_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'upload_job' in params:
body_params = params['upload_job']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/firmware-images/upload-jobs/{upload_job_id}', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UploadJob', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class DefaultApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def firmware_image_create(self, datafile, name, **kwargs):
'''Create an image # noqa: E501
Create a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_create(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The firmware image file to upload (required)
:param str name: The name of the firmware image (required)
:param str description: The description of the firmware image
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_image_create_with_http_info(self, datafile, name, **kwargs):
'''Create an image # noqa: E501
Create a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_create_with_http_info(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The firmware image file to upload (required)
:param str name: The name of the firmware image (required)
:param str description: The description of the firmware image
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_image_destroy(self, image_id, **kwargs):
'''Delete an image # noqa: E501
Delete a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_destroy(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_image_destroy_with_http_info(self, image_id, **kwargs):
'''Delete an image # noqa: E501
Delete a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_destroy_with_http_info(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_image_list(self, **kwargs):
'''List all images # noqa: E501
List all firmware images. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware images to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_checksum</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: FirmwareImagePage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_image_list_with_http_info(self, **kwargs):
'''List all images # noqa: E501
List all firmware images. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware images to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_checksum</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: FirmwareImagePage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_image_retrieve(self, image_id, **kwargs):
'''Get an image # noqa: E501
Retrieve a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_retrieve(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_image_retrieve_with_http_info(self, image_id, **kwargs):
'''Get an image # noqa: E501
Retrieve a firmware image. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_image_retrieve_with_http_info(image_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str image_id: The firmware image ID (required)
:return: FirmwareImage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_create(self, datafile, name, **kwargs):
'''Create a manifest # noqa: E501
Create a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_create(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The manifest file to create. The API gateway enforces the account-specific file size. (required)
:param str name: The name of the firmware manifest (required)
:param str description: The description of the firmware manifest
:param file key_table: The key table of pre-shared keys for devices
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_create_with_http_info(self, datafile, name, **kwargs):
'''Create a manifest # noqa: E501
Create a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_create_with_http_info(datafile, name, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param file datafile: The manifest file to create. The API gateway enforces the account-specific file size. (required)
:param str name: The name of the firmware manifest (required)
:param str description: The description of the firmware manifest
:param file key_table: The key table of pre-shared keys for devices
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_destroy(self, manifest_id, **kwargs):
'''Delete a manifest # noqa: E501
Delete a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_destroy(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_destroy_with_http_info(self, manifest_id, **kwargs):
'''Delete a manifest # noqa: E501
Delete a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_destroy_with_http_info(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_list(self, **kwargs):
'''List manifests # noqa: E501
List firmware manifests. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware manifests to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_class</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=mymanifest` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=mymanifest&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-manifest1,fw-manifest2`
:return: FirmwareManifestPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_list_with_http_info(self, **kwargs):
'''List manifests # noqa: E501
List firmware manifests. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many firmware manifests to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>datafile</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>datafile_size</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_class</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>timestamp</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=mymanifest` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=mymanifest&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-manifest1,fw-manifest2`
:return: FirmwareManifestPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_retrieve(self, manifest_id, **kwargs):
'''Get a manifest # noqa: E501
Retrieve a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_retrieve(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
'''
pass
def firmware_manifest_retrieve_with_http_info(self, manifest_id, **kwargs):
'''Get a manifest # noqa: E501
Retrieve a firmware manifest. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.firmware_manifest_retrieve_with_http_info(manifest_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str manifest_id: The firmware manifest ID (required)
:return: FirmwareManifest
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_archive(self, campaign_id, **kwargs):
'''Archive a campaign. # noqa: E501
This command will archive a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_archive(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_archive_with_http_info(self, campaign_id, **kwargs):
'''Archive a campaign. # noqa: E501
This command will archive a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_archive_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_create(self, campaign, **kwargs):
'''Create a campaign # noqa: E501
Create an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_create(campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UpdateCampaignPostRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_create_with_http_info(self, campaign, **kwargs):
'''Create a campaign # noqa: E501
Create an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_create_with_http_info(campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UpdateCampaignPostRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_destroy(self, campaign_id, **kwargs):
'''Delete a campaign # noqa: E501
Delete an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_destroy(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The ID of the update campaign (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_destroy_with_http_info(self, campaign_id, **kwargs):
'''Delete a campaign # noqa: E501
Delete an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_destroy_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The ID of the update campaign (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_list(self, **kwargs):
'''List all campaigns # noqa: E501
Get update campaigns for devices specified by a filter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many update campaigns to retrieve
:param str order: The order of the records. Acceptable values: ASC, DESC. Default: ASC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The below table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_filter</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>finished</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>root_manifest_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>started_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>state</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>when</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by campaign properties** `state__eq=[draft|scheduled|devicefectch|devicecopy|publishing|deploying|deployed|manifestremoved|expired]` `root_manifest_id__eq=43217771234242e594ddb433816c498a` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `state__eq=deployed&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UpdateCampaignPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_list_with_http_info(self, **kwargs):
'''List all campaigns # noqa: E501
Get update campaigns for devices specified by a filter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many update campaigns to retrieve
:param str order: The order of the records. Acceptable values: ASC, DESC. Default: ASC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The below table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>device_filter</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>finished</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>root_manifest_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>started_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>state</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>when</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1__eq=value1&key2__eq=value2&key3__eq=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by campaign properties** `state__eq=[draft|scheduled|devicefectch|devicecopy|publishing|deploying|deployed|manifestremoved|expired]` `root_manifest_id__eq=43217771234242e594ddb433816c498a` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `state__eq=deployed&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UpdateCampaignPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_metadata_list(self, campaign_id, **kwargs):
'''List all campaign device metadata # noqa: E501
Get campaign device metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_list(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param int limit: How many objects to retrieve in the page
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:return: CampaignDeviceMetadataPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_metadata_list_with_http_info(self, campaign_id, **kwargs):
'''List all campaign device metadata # noqa: E501
Get campaign device metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_list_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param int limit: How many objects to retrieve in the page
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:return: CampaignDeviceMetadataPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_metadata_retrieve(self, campaign_id, campaign_device_metadata_id, **kwargs):
'''Get a campaign device metadata # noqa: E501
Get update campaign metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_retrieve(campaign_id, campaign_device_metadata_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param str campaign_device_metadata_id: The campaign device metadata ID (required)
:return: CampaignDeviceMetadata
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_metadata_retrieve_with_http_info(self, campaign_id, campaign_device_metadata_id, **kwargs):
'''Get a campaign device metadata # noqa: E501
Get update campaign metadata. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metadata_retrieve_with_http_info(campaign_id, campaign_device_metadata_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The update campaign ID (required)
:param str campaign_device_metadata_id: The campaign device metadata ID (required)
:return: CampaignDeviceMetadata
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_metrics(self, campaign_id, **kwargs):
'''Get campaign metrics # noqa: E501
Get detailed statistics of a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metrics(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: CampaignMetrics
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_metrics_with_http_info(self, campaign_id, **kwargs):
'''Get campaign metrics # noqa: E501
Get detailed statistics of a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_metrics_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: CampaignMetrics
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_retrieve(self, campaign_id, **kwargs):
'''Get a campaign. # noqa: E501
Get an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_retrieve(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_retrieve_with_http_info(self, campaign_id, **kwargs):
'''Get a campaign. # noqa: E501
Get an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_retrieve_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_start(self, campaign_id, **kwargs):
'''Start a campaign. # noqa: E501
This command will begin the process of starting a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_start(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_start_with_http_info(self, campaign_id, **kwargs):
'''Start a campaign. # noqa: E501
This command will begin the process of starting a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_start_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_stop(self, campaign_id, **kwargs):
'''Stop a campaign. # noqa: E501
This command will begin the process of stopping a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_stop(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_stop_with_http_info(self, campaign_id, **kwargs):
'''Stop a campaign. # noqa: E501
This command will begin the process of stopping a campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_stop_with_http_info(campaign_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: The campaign ID (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_update(self, campaign_id, campaign, **kwargs):
'''Modify a campaign # noqa: E501
Modify an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_update(campaign_id, campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: (required)
:param UpdateCampaignPutRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_campaign_update_with_http_info(self, campaign_id, campaign, **kwargs):
'''Modify a campaign # noqa: E501
Modify an update campaign. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_campaign_update_with_http_info(campaign_id, campaign, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str campaign_id: (required)
:param UpdateCampaignPutRequest campaign: Update campaign (required)
:return: UpdateCampaign
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_chunk_create(self, content_length, upload_job_id, **kwargs):
'''Append a chunks to an upload job # noqa: E501
Append a chunks to an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_create(content_length, upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int content_length: (required)
:param str upload_job_id: Upload job ID (required)
:param str content_md5:
:param str chunk: Chunk
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_chunk_create_with_http_info(self, content_length, upload_job_id, **kwargs):
'''Append a chunks to an upload job # noqa: E501
Append a chunks to an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_create_with_http_info(content_length, upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int content_length: (required)
:param str upload_job_id: Upload job ID (required)
:param str content_md5:
:param str chunk: Chunk
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_chunk_list(self, upload_job_id, **kwargs):
'''List all metadata for uploaded chunks # noqa: E501
List all metadata for uploaded chunks # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_list(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param int limit: How many metadata items for uploaded chunks to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>hash</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>length</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `status__eq=in_progress` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `status__eq=in_progress&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `status__in=in_progress,success`
:return: UploadChunkInfoPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_chunk_list_with_http_info(self, upload_job_id, **kwargs):
'''List all metadata for uploaded chunks # noqa: E501
List all metadata for uploaded chunks # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_list_with_http_info(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param int limit: How many metadata items for uploaded chunks to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>hash</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>length</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `status__eq=in_progress` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `status__eq=in_progress&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `status__in=in_progress,success`
:return: UploadChunkInfoPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_chunk_retreive(self, upload_job_id, chunk_id, **kwargs):
'''Get metadata about a chunk # noqa: E501
Get metadata about a chunk # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_retreive(upload_job_id, chunk_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param str chunk_id: Chunk (required)
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_chunk_retreive_with_http_info(self, upload_job_id, chunk_id, **kwargs):
'''Get metadata about a chunk # noqa: E501
Get metadata about a chunk # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_chunk_retreive_with_http_info(upload_job_id, chunk_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:param str chunk_id: Chunk (required)
:return: UploadChunkInfo
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_create(self, upload_job, **kwargs):
'''Create a new upload job # noqa: E501
Create a new upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_create(upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UploadJob upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_create_with_http_info(self, upload_job, **kwargs):
'''Create a new upload job # noqa: E501
Create a new upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_create_with_http_info(upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param UploadJob upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_delete(self, upload_job_id, **kwargs):
'''Delete an upload job # noqa: E501
Delete an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_delete(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_delete_with_http_info(self, upload_job_id, **kwargs):
'''Delete an upload job # noqa: E501
Delete an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_delete_with_http_info(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_list(self, **kwargs):
'''Get all upload jobs # noqa: E501
Get all upload jobs # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_list(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many upload jobs to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>complete</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>firmware_image_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UploadJobPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_list_with_http_info(self, **kwargs):
'''Get all upload jobs # noqa: E501
Get all upload jobs # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_list_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param int limit: How many upload jobs to retrieve
:param str order: ASC or DESC
:param str after: The ID of the the item after which to retrieve the next page
:param str include: A comma-separated list of data fields to return. Currently supported: total_count
:param str filter: URL-encoded query string parameter to filter returned data `?filter={URL-encoded query string}` ###### Filterable fields: The table lists all the fields that can be filtered on with certain filters: <table> <thead> <tr> <th>Field</th> <th>= / __eq / __neq</th> <th>__in / __nin</th> <th>__lte / __gte</th> <tr> <thead> <tbody> <tr> <td>name</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>description</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>complete</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>firmware_image_id</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>status</td> <td>✓</td> <td>✓</td> <td> </td> </tr> <tr> <td>created_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>etag</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> <tr> <td>updated_at</td> <td>✓</td> <td>✓</td> <td>✓</td> </tr> </tbody> </table> The query string is made up of key-value pairs separated by ampersands. For example, this query: `key1=value1&key2=value2&key3=value3` would be URL-encoded as: `?filter=key1__eq%3Dvalue1%26key2__eq%3Dvalue2%26key3__eq%3Dvalue3` **Filtering by properties** `name__eq=myimage` **Filtering on date-time fields** Date-time fields should be specified in UTC RFC3339 format, `YYYY-MM-DDThh:mm:ss.msZ`. There are three permitted variations: * UTC RFC3339 with milliseconds. Example: `2016-11-30T16:25:12.1234Z` * UTC RFC3339 without milliseconds. Example: `2016-11-30T16:25:12Z` * UTC RFC3339 shortened without milliseconds and punctuation. Example: `20161130T162512Z` Date-time filtering supports three operators: * equality by appending `__eq` to the field name * greater than or equal to by appending `__gte` to the field name * less than or equal to by appending `__lte` to the field name `{field name}[|__eq|__lte|__gte]={UTC RFC3339 date-time}` Time ranges may be specified by including both the `__gte` and `__lte` forms in the filter. For example: `created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering on multiple fields** `name__eq=myimage&created_at__gte=2016-11-30T16:25:12.1234Z&created_at__lte=2016-12-30T00:00:00Z` **Filtering with filter operators** String field filtering supports the following operators: * equality: `__eq` * non-equality: `__neq` * in : `__in` * not in: `__nin` For `__in` and `__nin` filters list of parameters must be comma-separated: `name__in=fw-image1,fw-image2`
:return: UploadJobPage
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_retrieve(self, upload_job_id, **kwargs):
'''Get an upload job # noqa: E501
Get an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_retrieve(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_retrieve_with_http_info(self, upload_job_id, **kwargs):
'''Get an upload job # noqa: E501
Get an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_retrieve_with_http_info(upload_job_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_update(self, upload_job_id, upload_job, **kwargs):
'''Update an upload job # noqa: E501
Update an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_update(upload_job_id, upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job id (required)
:param UploadJob1 upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
'''
pass
def upload_job_update_with_http_info(self, upload_job_id, upload_job, **kwargs):
'''Update an upload job # noqa: E501
Update an upload job # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.upload_job_update_with_http_info(upload_job_id, upload_job, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str upload_job_id: Upload job id (required)
:param UploadJob1 upload_job: Upload job (required)
:return: UploadJob
If the method is called asynchronously,
returns the request thread.
'''
pass
| 56 | 55 | 49 | 7 | 27 | 20 | 4 | 0.75 | 1 | 3 | 1 | 0 | 55 | 1 | 55 | 55 | 2,754 | 437 | 1,504 | 381 | 1,448 | 1,126 | 956 | 381 | 900 | 10 | 1 | 2 | 233 |
2,585 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/statistics/models/successful_response.py
|
mbed_cloud._backends.statistics.models.successful_response.SuccessfulResponse
|
class SuccessfulResponse(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'after': 'str',
'data': 'list[Metric]',
'has_more': 'bool',
'limit': 'int',
'object': 'str',
'total_count': 'int'
}
attribute_map = {
'after': 'after',
'data': 'data',
'has_more': 'has_more',
'limit': 'limit',
'object': 'object',
'total_count': 'total_count'
}
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, total_count=None):
"""
SuccessfulResponse - a model defined in Swagger
"""
self._after = after
self._data = data
self._has_more = has_more
self._limit = limit
self._object = object
self._total_count = total_count
self.discriminator = None
@property
def after(self):
"""
Gets the after of this SuccessfulResponse.
The metric ID included in the request or null.
:return: The after of this SuccessfulResponse.
:rtype: str
"""
return self._after
@after.setter
def after(self, after):
"""
Sets the after of this SuccessfulResponse.
The metric ID included in the request or null.
:param after: The after of this SuccessfulResponse.
:type: str
"""
self._after = after
@property
def data(self):
"""
Gets the data of this SuccessfulResponse.
:return: The data of this SuccessfulResponse.
:rtype: list[Metric]
"""
return self._data
@data.setter
def data(self, data):
"""
Sets the data of this SuccessfulResponse.
:param data: The data of this SuccessfulResponse.
:type: list[Metric]
"""
self._data = data
@property
def has_more(self):
"""
Gets the has_more of this SuccessfulResponse.
Indicates whether there are more results for you to fetch in the next page.
:return: The has_more of this SuccessfulResponse.
:rtype: bool
"""
return self._has_more
@has_more.setter
def has_more(self, has_more):
"""
Sets the has_more of this SuccessfulResponse.
Indicates whether there are more results for you to fetch in the next page.
:param has_more: The has_more of this SuccessfulResponse.
:type: bool
"""
self._has_more = has_more
@property
def limit(self):
"""
Gets the limit of this SuccessfulResponse.
The limit used in the request to retrieve the results.
:return: The limit of this SuccessfulResponse.
:rtype: int
"""
return self._limit
@limit.setter
def limit(self, limit):
"""
Sets the limit of this SuccessfulResponse.
The limit used in the request to retrieve the results.
:param limit: The limit of this SuccessfulResponse.
:type: int
"""
self._limit = limit
@property
def object(self):
"""
Gets the object of this SuccessfulResponse.
API resource name.
:return: The object of this SuccessfulResponse.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this SuccessfulResponse.
API resource name.
:param object: The object of this SuccessfulResponse.
:type: str
"""
self._object = object
@property
def total_count(self):
"""
Gets the total_count of this SuccessfulResponse.
The total number of records available.
:return: The total_count of this SuccessfulResponse.
:rtype: int
"""
return self._total_count
@total_count.setter
def total_count(self, total_count):
"""
Sets the total_count of this SuccessfulResponse.
The total number of records available.
:param total_count: The total_count of this SuccessfulResponse.
:type: int
"""
self._total_count = total_count
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, SuccessfulResponse):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class SuccessfulResponse(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, after=None, data=None, has_more=None, limit=None, object=None, total_count=None):
'''
SuccessfulResponse - a model defined in Swagger
'''
pass
@property
def after(self):
'''
Gets the after of this SuccessfulResponse.
The metric ID included in the request or null.
:return: The after of this SuccessfulResponse.
:rtype: str
'''
pass
@after.setter
def after(self):
'''
Sets the after of this SuccessfulResponse.
The metric ID included in the request or null.
:param after: The after of this SuccessfulResponse.
:type: str
'''
pass
@property
def data(self):
'''
Gets the data of this SuccessfulResponse.
:return: The data of this SuccessfulResponse.
:rtype: list[Metric]
'''
pass
@data.setter
def data(self):
'''
Sets the data of this SuccessfulResponse.
:param data: The data of this SuccessfulResponse.
:type: list[Metric]
'''
pass
@property
def has_more(self):
'''
Gets the has_more of this SuccessfulResponse.
Indicates whether there are more results for you to fetch in the next page.
:return: The has_more of this SuccessfulResponse.
:rtype: bool
'''
pass
@has_more.setter
def has_more(self):
'''
Sets the has_more of this SuccessfulResponse.
Indicates whether there are more results for you to fetch in the next page.
:param has_more: The has_more of this SuccessfulResponse.
:type: bool
'''
pass
@property
def limit(self):
'''
Gets the limit of this SuccessfulResponse.
The limit used in the request to retrieve the results.
:return: The limit of this SuccessfulResponse.
:rtype: int
'''
pass
@limit.setter
def limit(self):
'''
Sets the limit of this SuccessfulResponse.
The limit used in the request to retrieve the results.
:param limit: The limit of this SuccessfulResponse.
:type: int
'''
pass
@property
def object(self):
'''
Gets the object of this SuccessfulResponse.
API resource name.
:return: The object of this SuccessfulResponse.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this SuccessfulResponse.
API resource name.
:param object: The object of this SuccessfulResponse.
:type: str
'''
pass
@property
def total_count(self):
'''
Gets the total_count of this SuccessfulResponse.
The total number of records available.
:return: The total_count of this SuccessfulResponse.
:rtype: int
'''
pass
@total_count.setter
def total_count(self):
'''
Sets the total_count of this SuccessfulResponse.
The total number of records available.
:param total_count: The total_count of this SuccessfulResponse.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 31 | 19 | 10 | 1 | 3 | 5 | 1 | 1.09 | 1 | 3 | 0 | 0 | 18 | 7 | 18 | 18 | 233 | 43 | 91 | 43 | 60 | 99 | 55 | 31 | 36 | 5 | 1 | 2 | 23 |
2,586 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/statistics/models/metric.py
|
mbed_cloud._backends.statistics.models.metric.Metric
|
class Metric(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'bootstraps_failed': 'int',
'bootstraps_pending': 'int',
'bootstraps_successful': 'int',
'connect_rest_api_error': 'int',
'connect_rest_api_success': 'int',
'deleted_registrations': 'int',
'device_observations': 'int',
'device_proxy_request_error': 'int',
'device_proxy_request_success': 'int',
'device_subscription_request_error': 'int',
'device_subscription_request_success': 'int',
'expired_registrations': 'int',
'full_registrations': 'int',
'handshakes_successful': 'int',
'id': 'str',
'registration_updates': 'int',
'timestamp': 'datetime',
'transactions': 'int'
}
attribute_map = {
'bootstraps_failed': 'bootstraps_failed',
'bootstraps_pending': 'bootstraps_pending',
'bootstraps_successful': 'bootstraps_successful',
'connect_rest_api_error': 'connect_rest_api_error',
'connect_rest_api_success': 'connect_rest_api_success',
'deleted_registrations': 'deleted_registrations',
'device_observations': 'device_observations',
'device_proxy_request_error': 'device_proxy_request_error',
'device_proxy_request_success': 'device_proxy_request_success',
'device_subscription_request_error': 'device_subscription_request_error',
'device_subscription_request_success': 'device_subscription_request_success',
'expired_registrations': 'expired_registrations',
'full_registrations': 'full_registrations',
'handshakes_successful': 'handshakes_successful',
'id': 'id',
'registration_updates': 'registration_updates',
'timestamp': 'timestamp',
'transactions': 'transactions'
}
def __init__(self, bootstraps_failed=None, bootstraps_pending=None, bootstraps_successful=None, connect_rest_api_error=None, connect_rest_api_success=None, deleted_registrations=None, device_observations=None, device_proxy_request_error=None, device_proxy_request_success=None, device_subscription_request_error=None, device_subscription_request_success=None, expired_registrations=None, full_registrations=None, handshakes_successful=None, id=None, registration_updates=None, timestamp=None, transactions=None):
"""
Metric - a model defined in Swagger
"""
self._bootstraps_failed = bootstraps_failed
self._bootstraps_pending = bootstraps_pending
self._bootstraps_successful = bootstraps_successful
self._connect_rest_api_error = connect_rest_api_error
self._connect_rest_api_success = connect_rest_api_success
self._deleted_registrations = deleted_registrations
self._device_observations = device_observations
self._device_proxy_request_error = device_proxy_request_error
self._device_proxy_request_success = device_proxy_request_success
self._device_subscription_request_error = device_subscription_request_error
self._device_subscription_request_success = device_subscription_request_success
self._expired_registrations = expired_registrations
self._full_registrations = full_registrations
self._handshakes_successful = handshakes_successful
self._id = id
self._registration_updates = registration_updates
self._timestamp = timestamp
self._transactions = transactions
self.discriminator = None
@property
def bootstraps_failed(self):
"""
Gets the bootstraps_failed of this Metric.
The number of failed bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_failed of this Metric.
:rtype: int
"""
return self._bootstraps_failed
@bootstraps_failed.setter
def bootstraps_failed(self, bootstraps_failed):
"""
Sets the bootstraps_failed of this Metric.
The number of failed bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_failed: The bootstraps_failed of this Metric.
:type: int
"""
self._bootstraps_failed = bootstraps_failed
@property
def bootstraps_pending(self):
"""
Gets the bootstraps_pending of this Metric.
The number of pending bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_pending of this Metric.
:rtype: int
"""
return self._bootstraps_pending
@bootstraps_pending.setter
def bootstraps_pending(self, bootstraps_pending):
"""
Sets the bootstraps_pending of this Metric.
The number of pending bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_pending: The bootstraps_pending of this Metric.
:type: int
"""
self._bootstraps_pending = bootstraps_pending
@property
def bootstraps_successful(self):
"""
Gets the bootstraps_successful of this Metric.
The number of successful bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_successful of this Metric.
:rtype: int
"""
return self._bootstraps_successful
@bootstraps_successful.setter
def bootstraps_successful(self, bootstraps_successful):
"""
Sets the bootstraps_successful of this Metric.
The number of successful bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_successful: The bootstraps_successful of this Metric.
:type: int
"""
self._bootstraps_successful = bootstraps_successful
@property
def connect_rest_api_error(self):
"""
Gets the connect_rest_api_error of this Metric.
The number of failed [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed.The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:return: The connect_rest_api_error of this Metric.
:rtype: int
"""
return self._connect_rest_api_error
@connect_rest_api_error.setter
def connect_rest_api_error(self, connect_rest_api_error):
"""
Sets the connect_rest_api_error of this Metric.
The number of failed [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed.The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:param connect_rest_api_error: The connect_rest_api_error of this Metric.
:type: int
"""
self._connect_rest_api_error = connect_rest_api_error
@property
def connect_rest_api_success(self):
"""
Gets the connect_rest_api_success of this Metric.
The number of successful [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed. The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:return: The connect_rest_api_success of this Metric.
:rtype: int
"""
return self._connect_rest_api_success
@connect_rest_api_success.setter
def connect_rest_api_success(self, connect_rest_api_success):
"""
Sets the connect_rest_api_success of this Metric.
The number of successful [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed. The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:param connect_rest_api_success: The connect_rest_api_success of this Metric.
:type: int
"""
self._connect_rest_api_success = connect_rest_api_success
@property
def deleted_registrations(self):
"""
Gets the deleted_registrations of this Metric.
The number of deleted registrations (deregistrations) linked to the account. Deregistration is the process of removing the device registration from the Device Management Connect registry. The deregistration is usually initiated by the device. Device Management Connect no longer handles requests for a deregistered device.
:return: The deleted_registrations of this Metric.
:rtype: int
"""
return self._deleted_registrations
@deleted_registrations.setter
def deleted_registrations(self, deleted_registrations):
"""
Sets the deleted_registrations of this Metric.
The number of deleted registrations (deregistrations) linked to the account. Deregistration is the process of removing the device registration from the Device Management Connect registry. The deregistration is usually initiated by the device. Device Management Connect no longer handles requests for a deregistered device.
:param deleted_registrations: The deleted_registrations of this Metric.
:type: int
"""
self._deleted_registrations = deleted_registrations
@property
def device_observations(self):
"""
Gets the device_observations of this Metric.
**(Beta)** The number of observations received by Device Management Connect from the devices linked to the account. The observations are pushed from the device to Device Management Connect when you have successfully subscribed to the device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_observations of this Metric.
:rtype: int
"""
return self._device_observations
@device_observations.setter
def device_observations(self, device_observations):
"""
Sets the device_observations of this Metric.
**(Beta)** The number of observations received by Device Management Connect from the devices linked to the account. The observations are pushed from the device to Device Management Connect when you have successfully subscribed to the device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_observations: The device_observations of this Metric.
:type: int
"""
self._device_observations = device_observations
@property
def device_proxy_request_error(self):
"""
Gets the device_proxy_request_error of this Metric.
**(Beta)** The number of failed proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_proxy_request_error of this Metric.
:rtype: int
"""
return self._device_proxy_request_error
@device_proxy_request_error.setter
def device_proxy_request_error(self, device_proxy_request_error):
"""
Sets the device_proxy_request_error of this Metric.
**(Beta)** The number of failed proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_proxy_request_error: The device_proxy_request_error of this Metric.
:type: int
"""
self._device_proxy_request_error = device_proxy_request_error
@property
def device_proxy_request_success(self):
"""
Gets the device_proxy_request_success of this Metric.
**(Beta)** The number of successful proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_proxy_request_success of this Metric.
:rtype: int
"""
return self._device_proxy_request_success
@device_proxy_request_success.setter
def device_proxy_request_success(self, device_proxy_request_success):
"""
Sets the device_proxy_request_success of this Metric.
**(Beta)** The number of successful proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_proxy_request_success: The device_proxy_request_success of this Metric.
:type: int
"""
self._device_proxy_request_success = device_proxy_request_success
@property
def device_subscription_request_error(self):
"""
Gets the device_subscription_request_error of this Metric.
**(Beta)** The number of failed subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_subscription_request_error of this Metric.
:rtype: int
"""
return self._device_subscription_request_error
@device_subscription_request_error.setter
def device_subscription_request_error(self, device_subscription_request_error):
"""
Sets the device_subscription_request_error of this Metric.
**(Beta)** The number of failed subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_subscription_request_error: The device_subscription_request_error of this Metric.
:type: int
"""
self._device_subscription_request_error = device_subscription_request_error
@property
def device_subscription_request_success(self):
"""
Gets the device_subscription_request_success of this Metric.
**(Beta)** The number of successful subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_subscription_request_success of this Metric.
:rtype: int
"""
return self._device_subscription_request_success
@device_subscription_request_success.setter
def device_subscription_request_success(self, device_subscription_request_success):
"""
Sets the device_subscription_request_success of this Metric.
**(Beta)** The number of successful subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_subscription_request_success: The device_subscription_request_success of this Metric.
:type: int
"""
self._device_subscription_request_success = device_subscription_request_success
@property
def expired_registrations(self):
"""
Gets the expired_registrations of this Metric.
The number of expired registrations linked to the account. Device Management Connect removes the device registrations when the devices cannot update their registration before the expiry of the lifetime. Device Management Connect no longer handles requests for a device whose registration has expired already.
:return: The expired_registrations of this Metric.
:rtype: int
"""
return self._expired_registrations
@expired_registrations.setter
def expired_registrations(self, expired_registrations):
"""
Sets the expired_registrations of this Metric.
The number of expired registrations linked to the account. Device Management Connect removes the device registrations when the devices cannot update their registration before the expiry of the lifetime. Device Management Connect no longer handles requests for a device whose registration has expired already.
:param expired_registrations: The expired_registrations of this Metric.
:type: int
"""
self._expired_registrations = expired_registrations
@property
def full_registrations(self):
"""
Gets the full_registrations of this Metric.
The number of full registrations linked to the account. Full registration is the process of registering a device with Device Management Connect by providing its lifetime and capabilities such as the resource structure.The registered status of the device does not guarantee that the device is active and accessible from Device Management Connect at any point of time.
:return: The full_registrations of this Metric.
:rtype: int
"""
return self._full_registrations
@full_registrations.setter
def full_registrations(self, full_registrations):
"""
Sets the full_registrations of this Metric.
The number of full registrations linked to the account. Full registration is the process of registering a device with Device Management Connect by providing its lifetime and capabilities such as the resource structure.The registered status of the device does not guarantee that the device is active and accessible from Device Management Connect at any point of time.
:param full_registrations: The full_registrations of this Metric.
:type: int
"""
self._full_registrations = full_registrations
@property
def handshakes_successful(self):
"""
Gets the handshakes_successful of this Metric.
The number of successful TLS handshakes the account has performed. The SSL or TLS handshake enables the SSL or TLS client and server to establish the secret keys with which they communicate. A successful TLS handshake is required for establishing a connection with Device Management Connect for any operaton such as registration, registration update and deregistration.
:return: The handshakes_successful of this Metric.
:rtype: int
"""
return self._handshakes_successful
@handshakes_successful.setter
def handshakes_successful(self, handshakes_successful):
"""
Sets the handshakes_successful of this Metric.
The number of successful TLS handshakes the account has performed. The SSL or TLS handshake enables the SSL or TLS client and server to establish the secret keys with which they communicate. A successful TLS handshake is required for establishing a connection with Device Management Connect for any operaton such as registration, registration update and deregistration.
:param handshakes_successful: The handshakes_successful of this Metric.
:type: int
"""
self._handshakes_successful = handshakes_successful
@property
def id(self):
"""
Gets the id of this Metric.
A unique metric ID.
:return: The id of this Metric.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this Metric.
A unique metric ID.
:param id: The id of this Metric.
:type: str
"""
self._id = id
@property
def registration_updates(self):
"""
Gets the registration_updates of this Metric.
The number of registration updates linked to the account. Registration update is the process of updating the registration status with Device Management Connect to update or extend the lifetime of the device.
:return: The registration_updates of this Metric.
:rtype: int
"""
return self._registration_updates
@registration_updates.setter
def registration_updates(self, registration_updates):
"""
Sets the registration_updates of this Metric.
The number of registration updates linked to the account. Registration update is the process of updating the registration status with Device Management Connect to update or extend the lifetime of the device.
:param registration_updates: The registration_updates of this Metric.
:type: int
"""
self._registration_updates = registration_updates
@property
def timestamp(self):
"""
Gets the timestamp of this Metric.
UTC time in RFC3339 format. The timestamp is the starting point of the interval for which the data is aggregated. Each interval includes data for the time greater than or equal to the timestamp and less than the next interval's starting point.
:return: The timestamp of this Metric.
:rtype: datetime
"""
return self._timestamp
@timestamp.setter
def timestamp(self, timestamp):
"""
Sets the timestamp of this Metric.
UTC time in RFC3339 format. The timestamp is the starting point of the interval for which the data is aggregated. Each interval includes data for the time greater than or equal to the timestamp and less than the next interval's starting point.
:param timestamp: The timestamp of this Metric.
:type: datetime
"""
self._timestamp = timestamp
@property
def transactions(self):
"""
Gets the transactions of this Metric.
The number of transaction events from or to devices linked to the account. A transaction is a 512-byte block of data processed by Device Management. It can be either sent by the device (device --> mbed cloud) or received by the device (Device Management --> device). A transaction does not include IP, TCP or UDP, TLS or DTLS packet overhead. It only contains the packet payload (full CoAP packet including CoAP headers).
:return: The transactions of this Metric.
:rtype: int
"""
return self._transactions
@transactions.setter
def transactions(self, transactions):
"""
Sets the transactions of this Metric.
The number of transaction events from or to devices linked to the account. A transaction is a 512-byte block of data processed by Device Management. It can be either sent by the device (device --> mbed cloud) or received by the device (Device Management --> device). A transaction does not include IP, TCP or UDP, TLS or DTLS packet overhead. It only contains the packet payload (full CoAP packet including CoAP headers).
:param transactions: The transactions of this Metric.
:type: int
"""
self._transactions = transactions
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Metric):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class Metric(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, bootstraps_failed=None, bootstraps_pending=None, bootstraps_successful=None, connect_rest_api_error=None, connect_rest_api_success=None, deleted_registrations=None, device_observations=None, device_proxy_request_error=None, device_proxy_request_success=None, device_subscription_request_error=None, device_subscription_request_success=None, expired_registrations=None, full_registrations=None, handshakes_successful=None, id=None, registration_updates=None, timestamp=None, transactions=None):
'''
Metric - a model defined in Swagger
'''
pass
@property
def bootstraps_failed(self):
'''
Gets the bootstraps_failed of this Metric.
The number of failed bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_failed of this Metric.
:rtype: int
'''
pass
@bootstraps_failed.setter
def bootstraps_failed(self):
'''
Sets the bootstraps_failed of this Metric.
The number of failed bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_failed: The bootstraps_failed of this Metric.
:type: int
'''
pass
@property
def bootstraps_pending(self):
'''
Gets the bootstraps_pending of this Metric.
The number of pending bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_pending of this Metric.
:rtype: int
'''
pass
@bootstraps_pending.setter
def bootstraps_pending(self):
'''
Sets the bootstraps_pending of this Metric.
The number of pending bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_pending: The bootstraps_pending of this Metric.
:type: int
'''
pass
@property
def bootstraps_successful(self):
'''
Gets the bootstraps_successful of this Metric.
The number of successful bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_successful of this Metric.
:rtype: int
'''
pass
@bootstraps_successful.setter
def bootstraps_successful(self):
'''
Sets the bootstraps_successful of this Metric.
The number of successful bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_successful: The bootstraps_successful of this Metric.
:type: int
'''
pass
@property
def connect_rest_api_error(self):
'''
Gets the connect_rest_api_error of this Metric.
The number of failed [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed.The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:return: The connect_rest_api_error of this Metric.
:rtype: int
'''
pass
@connect_rest_api_error.setter
def connect_rest_api_error(self):
'''
Sets the connect_rest_api_error of this Metric.
The number of failed [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed.The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:param connect_rest_api_error: The connect_rest_api_error of this Metric.
:type: int
'''
pass
@property
def connect_rest_api_success(self):
'''
Gets the connect_rest_api_success of this Metric.
The number of successful [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed. The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:return: The connect_rest_api_success of this Metric.
:rtype: int
'''
pass
@connect_rest_api_success.setter
def connect_rest_api_success(self):
'''
Sets the connect_rest_api_success of this Metric.
The number of successful [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed. The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:param connect_rest_api_success: The connect_rest_api_success of this Metric.
:type: int
'''
pass
@property
def deleted_registrations(self):
'''
Gets the deleted_registrations of this Metric.
The number of deleted registrations (deregistrations) linked to the account. Deregistration is the process of removing the device registration from the Device Management Connect registry. The deregistration is usually initiated by the device. Device Management Connect no longer handles requests for a deregistered device.
:return: The deleted_registrations of this Metric.
:rtype: int
'''
pass
@deleted_registrations.setter
def deleted_registrations(self):
'''
Sets the deleted_registrations of this Metric.
The number of deleted registrations (deregistrations) linked to the account. Deregistration is the process of removing the device registration from the Device Management Connect registry. The deregistration is usually initiated by the device. Device Management Connect no longer handles requests for a deregistered device.
:param deleted_registrations: The deleted_registrations of this Metric.
:type: int
'''
pass
@property
def device_observations(self):
'''
Gets the device_observations of this Metric.
**(Beta)** The number of observations received by Device Management Connect from the devices linked to the account. The observations are pushed from the device to Device Management Connect when you have successfully subscribed to the device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_observations of this Metric.
:rtype: int
'''
pass
@device_observations.setter
def device_observations(self):
'''
Sets the device_observations of this Metric.
**(Beta)** The number of observations received by Device Management Connect from the devices linked to the account. The observations are pushed from the device to Device Management Connect when you have successfully subscribed to the device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_observations: The device_observations of this Metric.
:type: int
'''
pass
@property
def device_proxy_request_error(self):
'''
Gets the device_proxy_request_error of this Metric.
**(Beta)** The number of failed proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_proxy_request_error of this Metric.
:rtype: int
'''
pass
@device_proxy_request_error.setter
def device_proxy_request_error(self):
'''
Sets the device_proxy_request_error of this Metric.
**(Beta)** The number of failed proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_proxy_request_error: The device_proxy_request_error of this Metric.
:type: int
'''
pass
@property
def device_proxy_request_success(self):
'''
Gets the device_proxy_request_success of this Metric.
**(Beta)** The number of successful proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_proxy_request_success of this Metric.
:rtype: int
'''
pass
@device_proxy_request_success.setter
def device_proxy_request_success(self):
'''
Sets the device_proxy_request_success of this Metric.
**(Beta)** The number of successful proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_proxy_request_success: The device_proxy_request_success of this Metric.
:type: int
'''
pass
@property
def device_subscription_request_error(self):
'''
Gets the device_subscription_request_error of this Metric.
**(Beta)** The number of failed subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_subscription_request_error of this Metric.
:rtype: int
'''
pass
@device_subscription_request_error.setter
def device_subscription_request_error(self):
'''
Sets the device_subscription_request_error of this Metric.
**(Beta)** The number of failed subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_subscription_request_error: The device_subscription_request_error of this Metric.
:type: int
'''
pass
@property
def device_subscription_request_success(self):
'''
Gets the device_subscription_request_success of this Metric.
**(Beta)** The number of successful subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_subscription_request_success of this Metric.
:rtype: int
'''
pass
@device_subscription_request_success.setter
def device_subscription_request_success(self):
'''
Sets the device_subscription_request_success of this Metric.
**(Beta)** The number of successful subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_subscription_request_success: The device_subscription_request_success of this Metric.
:type: int
'''
pass
@property
def expired_registrations(self):
'''
Gets the expired_registrations of this Metric.
The number of expired registrations linked to the account. Device Management Connect removes the device registrations when the devices cannot update their registration before the expiry of the lifetime. Device Management Connect no longer handles requests for a device whose registration has expired already.
:return: The expired_registrations of this Metric.
:rtype: int
'''
pass
@expired_registrations.setter
def expired_registrations(self):
'''
Sets the expired_registrations of this Metric.
The number of expired registrations linked to the account. Device Management Connect removes the device registrations when the devices cannot update their registration before the expiry of the lifetime. Device Management Connect no longer handles requests for a device whose registration has expired already.
:param expired_registrations: The expired_registrations of this Metric.
:type: int
'''
pass
@property
def full_registrations(self):
'''
Gets the full_registrations of this Metric.
The number of full registrations linked to the account. Full registration is the process of registering a device with Device Management Connect by providing its lifetime and capabilities such as the resource structure.The registered status of the device does not guarantee that the device is active and accessible from Device Management Connect at any point of time.
:return: The full_registrations of this Metric.
:rtype: int
'''
pass
@full_registrations.setter
def full_registrations(self):
'''
Sets the full_registrations of this Metric.
The number of full registrations linked to the account. Full registration is the process of registering a device with Device Management Connect by providing its lifetime and capabilities such as the resource structure.The registered status of the device does not guarantee that the device is active and accessible from Device Management Connect at any point of time.
:param full_registrations: The full_registrations of this Metric.
:type: int
'''
pass
@property
def handshakes_successful(self):
'''
Gets the handshakes_successful of this Metric.
The number of successful TLS handshakes the account has performed. The SSL or TLS handshake enables the SSL or TLS client and server to establish the secret keys with which they communicate. A successful TLS handshake is required for establishing a connection with Device Management Connect for any operaton such as registration, registration update and deregistration.
:return: The handshakes_successful of this Metric.
:rtype: int
'''
pass
@handshakes_successful.setter
def handshakes_successful(self):
'''
Sets the handshakes_successful of this Metric.
The number of successful TLS handshakes the account has performed. The SSL or TLS handshake enables the SSL or TLS client and server to establish the secret keys with which they communicate. A successful TLS handshake is required for establishing a connection with Device Management Connect for any operaton such as registration, registration update and deregistration.
:param handshakes_successful: The handshakes_successful of this Metric.
:type: int
'''
pass
@property
def id(self):
'''
Gets the id of this Metric.
A unique metric ID.
:return: The id of this Metric.
:rtype: str
'''
pass
@id.setter
def id(self):
'''
Sets the id of this Metric.
A unique metric ID.
:param id: The id of this Metric.
:type: str
'''
pass
@property
def registration_updates(self):
'''
Gets the registration_updates of this Metric.
The number of registration updates linked to the account. Registration update is the process of updating the registration status with Device Management Connect to update or extend the lifetime of the device.
:return: The registration_updates of this Metric.
:rtype: int
'''
pass
@registration_updates.setter
def registration_updates(self):
'''
Sets the registration_updates of this Metric.
The number of registration updates linked to the account. Registration update is the process of updating the registration status with Device Management Connect to update or extend the lifetime of the device.
:param registration_updates: The registration_updates of this Metric.
:type: int
'''
pass
@property
def timestamp(self):
'''
Gets the timestamp of this Metric.
UTC time in RFC3339 format. The timestamp is the starting point of the interval for which the data is aggregated. Each interval includes data for the time greater than or equal to the timestamp and less than the next interval's starting point.
:return: The timestamp of this Metric.
:rtype: datetime
'''
pass
@timestamp.setter
def timestamp(self):
'''
Sets the timestamp of this Metric.
UTC time in RFC3339 format. The timestamp is the starting point of the interval for which the data is aggregated. Each interval includes data for the time greater than or equal to the timestamp and less than the next interval's starting point.
:param timestamp: The timestamp of this Metric.
:type: datetime
'''
pass
@property
def transactions(self):
'''
Gets the transactions of this Metric.
The number of transaction events from or to devices linked to the account. A transaction is a 512-byte block of data processed by Device Management. It can be either sent by the device (device --> mbed cloud) or received by the device (Device Management --> device). A transaction does not include IP, TCP or UDP, TLS or DTLS packet overhead. It only contains the packet payload (full CoAP packet including CoAP headers).
:return: The transactions of this Metric.
:rtype: int
'''
pass
@transactions.setter
def transactions(self):
'''
Sets the transactions of this Metric.
The number of transaction events from or to devices linked to the account. A transaction is a 512-byte block of data processed by Device Management. It can be either sent by the device (device --> mbed cloud) or received by the device (Device Management --> device). A transaction does not include IP, TCP or UDP, TLS or DTLS packet overhead. It only contains the packet payload (full CoAP packet including CoAP headers).
:param transactions: The transactions of this Metric.
:type: int
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 79 | 43 | 10 | 1 | 3 | 6 | 1 | 1.23 | 1 | 3 | 0 | 0 | 42 | 19 | 42 | 42 | 547 | 103 | 199 | 103 | 120 | 245 | 115 | 67 | 72 | 5 | 1 | 2 | 47 |
2,587 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/statistics/models/fields.py
|
mbed_cloud._backends.statistics.models.fields.Fields
|
class Fields(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'message': 'str',
'name': 'str'
}
attribute_map = {
'message': 'message',
'name': 'name'
}
def __init__(self, message=None, name=None):
"""
Fields - a model defined in Swagger
"""
self._message = message
self._name = name
self.discriminator = None
@property
def message(self):
"""
Gets the message of this Fields.
Error description.
:return: The message of this Fields.
:rtype: str
"""
return self._message
@message.setter
def message(self, message):
"""
Sets the message of this Fields.
Error description.
:param message: The message of this Fields.
:type: str
"""
self._message = message
@property
def name(self):
"""
Gets the name of this Fields.
The field name in the request for which the validation has failed.
:return: The name of this Fields.
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""
Sets the name of this Fields.
The field name in the request for which the validation has failed.
:param name: The name of this Fields.
:type: str
"""
self._name = name
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Fields):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class Fields(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, message=None, name=None):
'''
Fields - a model defined in Swagger
'''
pass
@property
def message(self):
'''
Gets the message of this Fields.
Error description.
:return: The message of this Fields.
:rtype: str
'''
pass
@message.setter
def message(self):
'''
Sets the message of this Fields.
Error description.
:param message: The message of this Fields.
:type: str
'''
pass
@property
def name(self):
'''
Gets the name of this Fields.
The field name in the request for which the validation has failed.
:return: The name of this Fields.
:rtype: str
'''
pass
@name.setter
def name(self):
'''
Sets the name of this Fields.
The field name in the request for which the validation has failed.
:param name: The name of this Fields.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 15 | 11 | 9 | 1 | 4 | 4 | 2 | 0.96 | 1 | 3 | 0 | 0 | 10 | 3 | 10 | 10 | 131 | 23 | 55 | 23 | 40 | 53 | 35 | 19 | 24 | 5 | 1 | 2 | 15 |
2,588 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/statistics/models/error_response.py
|
mbed_cloud._backends.statistics.models.error_response.ErrorResponse
|
class ErrorResponse(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'code': 'int',
'fields': 'list[Fields]',
'message': 'str',
'object': 'str',
'request_id': 'str',
'type': 'str'
}
attribute_map = {
'code': 'code',
'fields': 'fields',
'message': 'message',
'object': 'object',
'request_id': 'request_id',
'type': 'type'
}
def __init__(self, code=None, fields=None, message=None, object=None, request_id=None, type=None):
"""
ErrorResponse - a model defined in Swagger
"""
self._code = code
self._fields = fields
self._message = message
self._object = object
self._request_id = request_id
self._type = type
self.discriminator = None
@property
def code(self):
"""
Gets the code of this ErrorResponse.
HTTP response code.
:return: The code of this ErrorResponse.
:rtype: int
"""
return self._code
@code.setter
def code(self, code):
"""
Sets the code of this ErrorResponse.
HTTP response code.
:param code: The code of this ErrorResponse.
:type: int
"""
self._code = code
@property
def fields(self):
"""
Gets the fields of this ErrorResponse.
Details of the error fields.
:return: The fields of this ErrorResponse.
:rtype: list[Fields]
"""
return self._fields
@fields.setter
def fields(self, fields):
"""
Sets the fields of this ErrorResponse.
Details of the error fields.
:param fields: The fields of this ErrorResponse.
:type: list[Fields]
"""
self._fields = fields
@property
def message(self):
"""
Gets the message of this ErrorResponse.
Description of the error.
:return: The message of this ErrorResponse.
:rtype: str
"""
return self._message
@message.setter
def message(self, message):
"""
Sets the message of this ErrorResponse.
Description of the error.
:param message: The message of this ErrorResponse.
:type: str
"""
self._message = message
@property
def object(self):
"""
Gets the object of this ErrorResponse.
Response type, always \"error\".
:return: The object of this ErrorResponse.
:rtype: str
"""
return self._object
@object.setter
def object(self, object):
"""
Sets the object of this ErrorResponse.
Response type, always \"error\".
:param object: The object of this ErrorResponse.
:type: str
"""
self._object = object
@property
def request_id(self):
"""
Gets the request_id of this ErrorResponse.
Request ID.
:return: The request_id of this ErrorResponse.
:rtype: str
"""
return self._request_id
@request_id.setter
def request_id(self, request_id):
"""
Sets the request_id of this ErrorResponse.
Request ID.
:param request_id: The request_id of this ErrorResponse.
:type: str
"""
self._request_id = request_id
@property
def type(self):
"""
Gets the type of this ErrorResponse.
Type of error.
:return: The type of this ErrorResponse.
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""
Sets the type of this ErrorResponse.
Type of error.
:param type: The type of this ErrorResponse.
:type: str
"""
self._type = type
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ErrorResponse):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class ErrorResponse(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, code=None, fields=None, message=None, object=None, request_id=None, type=None):
'''
ErrorResponse - a model defined in Swagger
'''
pass
@property
def code(self):
'''
Gets the code of this ErrorResponse.
HTTP response code.
:return: The code of this ErrorResponse.
:rtype: int
'''
pass
@code.setter
def code(self):
'''
Sets the code of this ErrorResponse.
HTTP response code.
:param code: The code of this ErrorResponse.
:type: int
'''
pass
@property
def fields(self):
'''
Gets the fields of this ErrorResponse.
Details of the error fields.
:return: The fields of this ErrorResponse.
:rtype: list[Fields]
'''
pass
@fields.setter
def fields(self):
'''
Sets the fields of this ErrorResponse.
Details of the error fields.
:param fields: The fields of this ErrorResponse.
:type: list[Fields]
'''
pass
@property
def message(self):
'''
Gets the message of this ErrorResponse.
Description of the error.
:return: The message of this ErrorResponse.
:rtype: str
'''
pass
@message.setter
def message(self):
'''
Sets the message of this ErrorResponse.
Description of the error.
:param message: The message of this ErrorResponse.
:type: str
'''
pass
@property
def object(self):
'''
Gets the object of this ErrorResponse.
Response type, always "error".
:return: The object of this ErrorResponse.
:rtype: str
'''
pass
@object.setter
def object(self):
'''
Sets the object of this ErrorResponse.
Response type, always "error".
:param object: The object of this ErrorResponse.
:type: str
'''
pass
@property
def request_id(self):
'''
Gets the request_id of this ErrorResponse.
Request ID.
:return: The request_id of this ErrorResponse.
:rtype: str
'''
pass
@request_id.setter
def request_id(self):
'''
Sets the request_id of this ErrorResponse.
Request ID.
:param request_id: The request_id of this ErrorResponse.
:type: str
'''
pass
@property
def type(self):
'''
Gets the type of this ErrorResponse.
Type of error.
:return: The type of this ErrorResponse.
:rtype: str
'''
pass
@type.setter
def type(self):
'''
Sets the type of this ErrorResponse.
Type of error.
:param type: The type of this ErrorResponse.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 31 | 19 | 10 | 1 | 3 | 5 | 1 | 1.11 | 1 | 3 | 0 | 0 | 18 | 7 | 18 | 18 | 235 | 43 | 91 | 43 | 60 | 101 | 55 | 31 | 36 | 5 | 1 | 2 | 23 |
2,589 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/statistics/configuration.py
|
mbed_cloud._backends.statistics.configuration.Configuration
|
class Configuration(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
"""
def __init__(self):
"""Constructor"""
# Default Base url
self.host = "http://api.us-east-1.mbedcloud.com"
# Temp file folder for downloading files
self.temp_folder_path = None
# Authentication Settings
# dict to store API key(s)
self.api_key = {}
# dict to store API prefix (e.g. Bearer)
self.api_key_prefix = {}
# Username for HTTP basic authentication
self.username = ""
# Password for HTTP basic authentication
self.password = ""
# Logging Settings
self.logger = {}
self.logger["package_logger"] = logging.getLogger("statistics")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
# Log format
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
# Log stream handler
self.logger_stream_handler = None
# Log file handler
self.logger_file_handler = None
# Debug file location
self.logger_file = None
# Debug switch
self.debug = False
# SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API
# from https server.
self.verify_ssl = True
# Set this to customize the certificate file to verify the peer.
self.ssl_ca_cert = None
# client certificate file
self.cert_file = None
# client key file
self.key_file = None
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None
# urllib3 connection pool's maximum number of connections saved
# per pool. urllib3 uses 1 connection as default value, but this is
# not the best value when you are making a lot of possibly parallel
# requests to the same host, which is often the case here.
# cpu_count * 5 is used as default value to increase performance.
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# Proxy URL
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler)
else:
# If not set logging file,
# then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if (self.api_key.get(identifier) and
self.api_key_prefix.get(identifier)):
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501
elif self.api_key.get(identifier):
return self.api_key[identifier]
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
return {
'Bearer':
{
'type': 'api_key',
'in': 'header',
'key': 'Authorization',
'value': self.get_api_key_with_prefix('Authorization')
},
}
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 3\n"\
"SDK Package Version: 1.0.0".\
format(env=sys.platform, pyversion=sys.version)
|
class Configuration(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
'''
def __init__(self):
'''Constructor'''
pass
@property
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@logger_file.setter
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@property
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@debug.setter
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@property
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
@logger_format.setter
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
def get_api_key_with_prefix(self, identifier):
'''Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
'''
pass
def get_basic_auth_token(self):
'''Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
'''
pass
def auth_settings(self):
'''Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
'''
pass
def to_debug_report(self):
'''Gets the essential information for debugging.
:return: The report for debugging.
'''
pass
| 18 | 12 | 17 | 2 | 8 | 7 | 2 | 0.92 | 1 | 3 | 0 | 0 | 11 | 21 | 11 | 11 | 208 | 32 | 92 | 41 | 74 | 85 | 67 | 35 | 55 | 6 | 1 | 3 | 21 |
2,590 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/statistics/apis/statistics_api.py
|
mbed_cloud._backends.statistics.apis.statistics_api.StatisticsApi
|
class StatisticsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_metrics(self, include, interval, **kwargs): # noqa: E501
"""Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, { \"id\": \"015d867e2400015e306fffff005374617473000\", \"timestamp\": \"2017-07-28T00:00:00Z\", \"transactions\": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"has_more\": true, \"data\": [ { \"id\": \"015d1a589800015e306fffff005374617473000\", \"timestamp\": \"2017-07-07T00:00:00Z\", \"transactions\": 26381 }, . . . { \"id\": \"015d7c316c00015e306fffff005374617473000\", \"timestamp\": \"2017-07-26T00:00:00Z\", \"transactions\": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, . . . { \"id\": \"015de3309c00015e306fffff005374617473000\", \"timestamp\": \"2017-08-15T00:00:00Z\", \"transactions\": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_metrics_with_http_info(include, interval, **kwargs) # noqa: E501
else:
(data) = self.get_metrics_with_http_info(include, interval, **kwargs) # noqa: E501
return data
def get_metrics_with_http_info(self, include, interval, **kwargs): # noqa: E501
"""Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics_with_http_info(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, { \"id\": \"015d867e2400015e306fffff005374617473000\", \"timestamp\": \"2017-07-28T00:00:00Z\", \"transactions\": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"has_more\": true, \"data\": [ { \"id\": \"015d1a589800015e306fffff005374617473000\", \"timestamp\": \"2017-07-07T00:00:00Z\", \"transactions\": 26381 }, . . . { \"id\": \"015d7c316c00015e306fffff005374617473000\", \"timestamp\": \"2017-07-26T00:00:00Z\", \"transactions\": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, . . . { \"id\": \"015de3309c00015e306fffff005374617473000\", \"timestamp\": \"2017-08-15T00:00:00Z\", \"transactions\": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['include', 'interval', 'start', 'end', 'period', 'limit', 'after', 'order'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_metrics" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'include' is set
if ('include' not in params or
params['include'] is None):
raise ValueError("Missing the required parameter `include` when calling `get_metrics`") # noqa: E501
# verify the required parameter 'interval' is set
if ('interval' not in params or
params['interval'] is None):
raise ValueError("Missing the required parameter `interval` when calling `get_metrics`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
if 'start' in params:
query_params.append(('start', params['start'])) # noqa: E501
if 'end' in params:
query_params.append(('end', params['end'])) # noqa: E501
if 'period' in params:
query_params.append(('period', params['period'])) # noqa: E501
if 'interval' in params:
query_params.append(('interval', params['interval'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/metrics', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SuccessfulResponse', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class StatisticsApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def get_metrics(self, include, interval, **kwargs):
'''Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, { "id": "015d867e2400015e306fffff005374617473000", "timestamp": "2017-07-28T00:00:00Z", "transactions": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { "object": "list", "limit": 20, "total_count": 54, "has_more": true, "data": [ { "id": "015d1a589800015e306fffff005374617473000", "timestamp": "2017-07-07T00:00:00Z", "transactions": 26381 }, . . . { "id": "015d7c316c00015e306fffff005374617473000", "timestamp": "2017-07-26T00:00:00Z", "transactions": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, . . . { "id": "015de3309c00015e306fffff005374617473000", "timestamp": "2017-08-15T00:00:00Z", "transactions": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_metrics_with_http_info(self, include, interval, **kwargs):
'''Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics_with_http_info(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, { "id": "015d867e2400015e306fffff005374617473000", "timestamp": "2017-07-28T00:00:00Z", "transactions": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { "object": "list", "limit": 20, "total_count": 54, "has_more": true, "data": [ { "id": "015d1a589800015e306fffff005374617473000", "timestamp": "2017-07-07T00:00:00Z", "transactions": 26381 }, . . . { "id": "015d7c316c00015e306fffff005374617473000", "timestamp": "2017-07-26T00:00:00Z", "transactions": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, . . . { "id": "015de3309c00015e306fffff005374617473000", "timestamp": "2017-08-15T00:00:00Z", "transactions": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
'''
pass
| 4 | 3 | 43 | 5 | 24 | 20 | 6 | 0.86 | 1 | 3 | 1 | 0 | 3 | 1 | 3 | 3 | 138 | 18 | 74 | 17 | 70 | 64 | 53 | 17 | 49 | 13 | 1 | 2 | 17 |
2,591 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/statistics/apis/account_api.py
|
mbed_cloud._backends.statistics.apis.account_api.AccountApi
|
class AccountApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_metrics(self, include, interval, **kwargs): # noqa: E501
"""Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, { \"id\": \"015d867e2400015e306fffff005374617473000\", \"timestamp\": \"2017-07-28T00:00:00Z\", \"transactions\": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"has_more\": true, \"data\": [ { \"id\": \"015d1a589800015e306fffff005374617473000\", \"timestamp\": \"2017-07-07T00:00:00Z\", \"transactions\": 26381 }, . . . { \"id\": \"015d7c316c00015e306fffff005374617473000\", \"timestamp\": \"2017-07-26T00:00:00Z\", \"transactions\": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, . . . { \"id\": \"015de3309c00015e306fffff005374617473000\", \"timestamp\": \"2017-08-15T00:00:00Z\", \"transactions\": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_metrics_with_http_info(include, interval, **kwargs) # noqa: E501
else:
(data) = self.get_metrics_with_http_info(include, interval, **kwargs) # noqa: E501
return data
def get_metrics_with_http_info(self, include, interval, **kwargs): # noqa: E501
"""Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics_with_http_info(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, { \"id\": \"015d867e2400015e306fffff005374617473000\", \"timestamp\": \"2017-07-28T00:00:00Z\", \"transactions\": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"has_more\": true, \"data\": [ { \"id\": \"015d1a589800015e306fffff005374617473000\", \"timestamp\": \"2017-07-07T00:00:00Z\", \"transactions\": 26381 }, . . . { \"id\": \"015d7c316c00015e306fffff005374617473000\", \"timestamp\": \"2017-07-26T00:00:00Z\", \"transactions\": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \\ -H \"Authorization : Bearer <valid access Token>\" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { \"object\": \"list\", \"limit\": 20, \"total_count\": 54, \"after\": \"2017-07-26T00:00:00Z\", \"has_more\": true, \"data\": [ { \"id\": \"015d8157c800015e306fffff005374617473000\", \"timestamp\": \"2017-07-27T00:00:00Z\", \"transactions\": 27366 }, . . . { \"id\": \"015de3309c00015e306fffff005374617473000\", \"timestamp\": \"2017-08-15T00:00:00Z\", \"transactions\": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['include', 'interval', 'start', 'end', 'period', 'limit', 'after', 'order'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_metrics" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'include' is set
if ('include' not in params or
params['include'] is None):
raise ValueError("Missing the required parameter `include` when calling `get_metrics`") # noqa: E501
# verify the required parameter 'interval' is set
if ('interval' not in params or
params['interval'] is None):
raise ValueError("Missing the required parameter `interval` when calling `get_metrics`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'include' in params:
query_params.append(('include', params['include'])) # noqa: E501
if 'start' in params:
query_params.append(('start', params['start'])) # noqa: E501
if 'end' in params:
query_params.append(('end', params['end'])) # noqa: E501
if 'period' in params:
query_params.append(('period', params['period'])) # noqa: E501
if 'interval' in params:
query_params.append(('interval', params['interval'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'after' in params:
query_params.append(('after', params['after'])) # noqa: E501
if 'order' in params:
query_params.append(('order', params['order'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v3/metrics', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SuccessfulResponse', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class AccountApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def get_metrics(self, include, interval, **kwargs):
'''Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, { "id": "015d867e2400015e306fffff005374617473000", "timestamp": "2017-07-28T00:00:00Z", "transactions": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { "object": "list", "limit": 20, "total_count": 54, "has_more": true, "data": [ { "id": "015d1a589800015e306fffff005374617473000", "timestamp": "2017-07-07T00:00:00Z", "transactions": 26381 }, . . . { "id": "015d7c316c00015e306fffff005374617473000", "timestamp": "2017-07-26T00:00:00Z", "transactions": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, . . . { "id": "015de3309c00015e306fffff005374617473000", "timestamp": "2017-08-15T00:00:00Z", "transactions": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_metrics_with_http_info(self, include, interval, **kwargs):
'''Provides account-specific statistics for other cloud services. # noqa: E501
This REST API is used to get account-specific statistics. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_metrics_with_http_info(include, interval, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str include: A comma-separated list of requested metrics and total_count (if included, the response will contain total_count to specify the total number of records available). Supported values are: - `transactions` - `full_registrations` - `registration_updates` - `deleted_registrations` - `expired_registrations` - `bootstraps_successful` - `bootstraps_failed` - `bootstraps_pending` - `handshakes_successful` - `connect_rest_api_success` - `connect_rest_api_error` - `device_proxy_request_success` - `device_proxy_request_error` - `device_subscription_request_success` - `device_subscription_request_error` - `device_observations` - `total_count` **Note:** The metrics device_proxy_request_success, device_proxy_request_error, device_subscription_request_success, device_subscription_request_error and device_observations monitor only the response from the device to Mbed Cloud Connect and they do not confirm that the response is delivered to client callback URLs used when you try to access device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints. New metrics will be added to monitor the response delivery to client callback URLs later. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170207&end=20170407&interval=1d' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, { "id": "015d867e2400015e306fffff005374617473000", "timestamp": "2017-07-28T00:00:00Z", "transactions": 27480 } ] } ``` (required)
:param str interval: Group the data by this interval in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The maximum interval cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w. (required)
:param date start: UTC time/year/date in RFC3339 format. Fetch the data with timestamp greater than or equal to this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param date end: UTC time/year/date in RFC3339 format. Fetch the data with timestamp less than this value. Sample values: 20170207T092056990Z / 2017-02-07T09:20:56.990Z / 2017 / 20170207. The maximum time between start and end parameters cannot exceed more than one year (365 days). The parameter is not mandatory, if the period is specified.
:param str period: Period. Fetch the data for the period in minutes, hours, days or weeks. Sample values: 5m, 2h, 3d, 4w. The parameter is not mandatory, if the start and end time are specified. The maximum period cannot exceed one year (365 days). The allowed ranges are 5m-525600m/1h-8760h/1d-365d/1w-53w.
:param int limit: The number of results to return. The default value is 50, minimum 2 and maximum 1000.
:param str after: The metric ID after which to start fetching. This also can be used for pagination as follows. **Example usage:** ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20' { "object": "list", "limit": 20, "total_count": 54, "has_more": true, "data": [ { "id": "015d1a589800015e306fffff005374617473000", "timestamp": "2017-07-07T00:00:00Z", "transactions": 26381 }, . . . { "id": "015d7c316c00015e306fffff005374617473000", "timestamp": "2017-07-26T00:00:00Z", "transactions": 25569 } ] } ``` If the parameter “has more” is true, it indicates that the list is not complete and more values are available. You can give the last ID of the list as the value of the “after” query parameter, and you get the next page of values. You can keep doing this until “has more” is false. ``` curl -X GET \ -H "Authorization : Bearer <valid access Token>" 'https://api.us-east-1.mbedcloud.com/v3/metrics?include=transactions,total_count&start=20170707&end=20170829&interval=1d&limit=20&after=015d7c316c00015e306fffff005374617473000' { "object": "list", "limit": 20, "total_count": 54, "after": "2017-07-26T00:00:00Z", "has_more": true, "data": [ { "id": "015d8157c800015e306fffff005374617473000", "timestamp": "2017-07-27T00:00:00Z", "transactions": 27366 }, . . . { "id": "015de3309c00015e306fffff005374617473000", "timestamp": "2017-08-15T00:00:00Z", "transactions": 24707 } ] } ```
:param str order: The order of the records to return. Available values are ASC and DESC. The default value is ASC.
:return: SuccessfulResponse
If the method is called asynchronously,
returns the request thread.
'''
pass
| 4 | 3 | 43 | 5 | 24 | 20 | 6 | 0.86 | 1 | 3 | 1 | 0 | 3 | 1 | 3 | 3 | 138 | 18 | 74 | 17 | 70 | 64 | 53 | 17 | 49 | 13 | 1 | 2 | 17 |
2,592 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/models/webhook.py
|
mbed_cloud._backends.mds.models.webhook.Webhook
|
class Webhook(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'headers': 'dict(str, str)',
'url': 'str'
}
attribute_map = {
'headers': 'headers',
'url': 'url'
}
def __init__(self, headers=None, url=None):
"""
Webhook - a model defined in Swagger
"""
self._headers = headers
self._url = url
self.discriminator = None
@property
def headers(self):
"""
Gets the headers of this Webhook.
The headers (key/value) sent with the notification. Optional.
:return: The headers of this Webhook.
:rtype: dict(str, str)
"""
return self._headers
@headers.setter
def headers(self, headers):
"""
Sets the headers of this Webhook.
The headers (key/value) sent with the notification. Optional.
:param headers: The headers of this Webhook.
:type: dict(str, str)
"""
self._headers = headers
@property
def url(self):
"""
Gets the url of this Webhook.
The URL to which the notifications are sent. We recommend that you serve this URL over HTTPS.
:return: The url of this Webhook.
:rtype: str
"""
return self._url
@url.setter
def url(self, url):
"""
Sets the url of this Webhook.
The URL to which the notifications are sent. We recommend that you serve this URL over HTTPS.
:param url: The url of this Webhook.
:type: str
"""
if url is None:
raise ValueError("Invalid value for `url`, must not be `None`")
self._url = url
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Webhook):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class Webhook(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, headers=None, url=None):
'''
Webhook - a model defined in Swagger
'''
pass
@property
def headers(self):
'''
Gets the headers of this Webhook.
The headers (key/value) sent with the notification. Optional.
:return: The headers of this Webhook.
:rtype: dict(str, str)
'''
pass
@headers.setter
def headers(self):
'''
Sets the headers of this Webhook.
The headers (key/value) sent with the notification. Optional.
:param headers: The headers of this Webhook.
:type: dict(str, str)
'''
pass
@property
def url(self):
'''
Gets the url of this Webhook.
The URL to which the notifications are sent. We recommend that you serve this URL over HTTPS.
:return: The url of this Webhook.
:rtype: str
'''
pass
@url.setter
def url(self):
'''
Sets the url of this Webhook.
The URL to which the notifications are sent. We recommend that you serve this URL over HTTPS.
:param url: The url of this Webhook.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 15 | 11 | 10 | 1 | 4 | 4 | 2 | 0.93 | 1 | 4 | 0 | 0 | 10 | 3 | 10 | 10 | 133 | 23 | 57 | 23 | 42 | 53 | 37 | 19 | 26 | 5 | 1 | 2 | 16 |
2,593 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/apis/subscriptions_api.py
|
mbed_cloud._backends.mds.apis.subscriptions_api.SubscriptionsApi
|
class SubscriptionsApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def add_resource_subscription(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Subscribe to a resource path # noqa: E501
The Device Management Connect eventing model consists of observable resources. This means that endpoints can deliver updated resource content, periodically or with a more sophisticated solution-dependent logic. The OMA LwM2M resource model including objects, object instances, resources and resource instances is also supported. Applications can subscribe to objects, object instances or individual resources to make the device to provide value change notifications to Device Management Connect service. An application needs to call a `/notification/callback` method to get Device Management Connect to push notifications of the resource changes. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). All manual subscriptions are removed during a full device registration and applications need to re-subscribe at that point. To avoid this, you can use `/subscriptions` to set a pre-subscription. **Example usage:** curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.add_resource_subscription(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.add_resource_subscription_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
else:
(data) = self.add_resource_subscription_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
return data
def add_resource_subscription_with_http_info(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Subscribe to a resource path # noqa: E501
The Device Management Connect eventing model consists of observable resources. This means that endpoints can deliver updated resource content, periodically or with a more sophisticated solution-dependent logic. The OMA LwM2M resource model including objects, object instances, resources and resource instances is also supported. Applications can subscribe to objects, object instances or individual resources to make the device to provide value change notifications to Device Management Connect service. An application needs to call a `/notification/callback` method to get Device Management Connect to push notifications of the resource changes. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). All manual subscriptions are removed during a full device registration and applications need to re-subscribe at that point. To avoid this, you can use `/subscriptions` to set a pre-subscription. **Example usage:** curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.add_resource_subscription_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', '_resource_path'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method add_resource_subscription" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `add_resource_subscription`") # noqa: E501
# verify the required parameter '_resource_path' is set
if ('_resource_path' not in params or
params['_resource_path'] is None):
raise ValueError("Missing the required parameter `_resource_path` when calling `add_resource_subscription`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
if '_resource_path' in params:
path_params['resourcePath'] = params['_resource_path'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions/{device-id}/{resourcePath}', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def check_resource_subscription(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Read subscription status # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.check_resource_subscription(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.check_resource_subscription_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
else:
(data) = self.check_resource_subscription_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
return data
def check_resource_subscription_with_http_info(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Read subscription status # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.check_resource_subscription_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', '_resource_path'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method check_resource_subscription" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `check_resource_subscription`") # noqa: E501
# verify the required parameter '_resource_path' is set
if ('_resource_path' not in params or
params['_resource_path'] is None):
raise ValueError("Missing the required parameter `_resource_path` when calling `check_resource_subscription`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
if '_resource_path' in params:
path_params['resourcePath'] = params['_resource_path'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions/{device-id}/{resourcePath}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_endpoint_subscriptions(self, device_id, **kwargs): # noqa: E501
"""Delete subscriptions from an endpoint # noqa: E501
Deletes all resource subscriptions in a single endpoint. **Example usage:** curl -X DELETE \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_endpoint_subscriptions(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.delete_endpoint_subscriptions_with_http_info(device_id, **kwargs) # noqa: E501
else:
(data) = self.delete_endpoint_subscriptions_with_http_info(device_id, **kwargs) # noqa: E501
return data
def delete_endpoint_subscriptions_with_http_info(self, device_id, **kwargs): # noqa: E501
"""Delete subscriptions from an endpoint # noqa: E501
Deletes all resource subscriptions in a single endpoint. **Example usage:** curl -X DELETE \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_endpoint_subscriptions_with_http_info(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_endpoint_subscriptions" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `delete_endpoint_subscriptions`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions/{device-id}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_pre_subscriptions(self, **kwargs): # noqa: E501
"""Remove pre-subscriptions # noqa: E501
Removes pre-subscriptions. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_pre_subscriptions(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.delete_pre_subscriptions_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.delete_pre_subscriptions_with_http_info(**kwargs) # noqa: E501
return data
def delete_pre_subscriptions_with_http_info(self, **kwargs): # noqa: E501
"""Remove pre-subscriptions # noqa: E501
Removes pre-subscriptions. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_pre_subscriptions_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_pre_subscriptions" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_resource_subscription(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Remove a subscription # noqa: E501
To remove an existing subscription from a resource path. **Example usage:** curl -X DELETE \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_subscription(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.delete_resource_subscription_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
else:
(data) = self.delete_resource_subscription_with_http_info(device_id, _resource_path, **kwargs) # noqa: E501
return data
def delete_resource_subscription_with_http_info(self, device_id, _resource_path, **kwargs): # noqa: E501
"""Remove a subscription # noqa: E501
To remove an existing subscription from a resource path. **Example usage:** curl -X DELETE \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_subscription_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id', '_resource_path'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_resource_subscription" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `delete_resource_subscription`") # noqa: E501
# verify the required parameter '_resource_path' is set
if ('_resource_path' not in params or
params['_resource_path'] is None):
raise ValueError("Missing the required parameter `_resource_path` when calling `delete_resource_subscription`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
if '_resource_path' in params:
path_params['resourcePath'] = params['_resource_path'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions/{device-id}/{resourcePath}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_endpoint_subscriptions(self, device_id, **kwargs): # noqa: E501
"""Read endpoints subscriptions # noqa: E501
Lists all subscribed resources from a single endpoint. **Example usage:** curl -X GET \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_subscriptions(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that ID must be an exact match. You cannot use wildcards here. (required)
:return: str
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_endpoint_subscriptions_with_http_info(device_id, **kwargs) # noqa: E501
else:
(data) = self.get_endpoint_subscriptions_with_http_info(device_id, **kwargs) # noqa: E501
return data
def get_endpoint_subscriptions_with_http_info(self, device_id, **kwargs): # noqa: E501
"""Read endpoints subscriptions # noqa: E501
Lists all subscribed resources from a single endpoint. **Example usage:** curl -X GET \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \\ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_subscriptions_with_http_info(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that ID must be an exact match. You cannot use wildcards here. (required)
:return: str
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['device_id'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_endpoint_subscriptions" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_id' is set
if ('device_id' not in params or
params['device_id'] is None):
raise ValueError("Missing the required parameter `device_id` when calling `get_endpoint_subscriptions`") # noqa: E501
collection_formats = {}
path_params = {}
if 'device_id' in params:
path_params['device-id'] = params['device_id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['text/uri-list']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions/{device-id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_pre_subscriptions(self, **kwargs): # noqa: E501
"""Get pre-subscriptions # noqa: E501
You can retrieve the pre-subscription data with the GET operation. The server returns with the same JSON structure as described above. If there are no pre-subscribed resources, it returns with an empty array. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_pre_subscriptions(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: PresubscriptionArray
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.get_pre_subscriptions_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_pre_subscriptions_with_http_info(**kwargs) # noqa: E501
return data
def get_pre_subscriptions_with_http_info(self, **kwargs): # noqa: E501
"""Get pre-subscriptions # noqa: E501
You can retrieve the pre-subscription data with the GET operation. The server returns with the same JSON structure as described above. If there are no pre-subscribed resources, it returns with an empty array. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_pre_subscriptions_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: PresubscriptionArray
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_pre_subscriptions" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='PresubscriptionArray', # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_pre_subscriptions(self, presubsription, **kwargs): # noqa: E501
"""Set pre-subscriptions # noqa: E501
Pre-subscription is a set of rules and patterns put by the application. When an endpoint registers and its ID, type and registered resources match the pre-subscription data, Device Management Connect sends subscription requests to the device automatically. The pattern may include the endpoint ID (optionally having an `*` character at the end), endpoint type, a list of resources or expressions with an `*` character at the end. Subscriptions based on pre-subscriptions are done when device registers or does register update. To remove the pre-subscription data, put an empty array as a rule. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). **Limits**: - The maximum length of the endpoint name and endpoint type is 64 characters. - The maximum length of the resource path is 128 characters. - You can listen to 256 separate resource paths. - The maximum number of pre-subscription entries is 1024. **Example request:** ``` curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions \\ -H 'authorization: Bearer {api-key}' \\ -H 'content-type: application/json' \\ -d '[ { \"endpoint-name\": \"node-001\", \"resource-path\": [\"/dev\"] }, { \"endpoint-type\": \"Light\", \"resource-path\": [\"/sen/*\"] }, { \"endpoint-name\": \"node*\" }, { \"endpoint-type\": \"Sensor\" }, { \"resource-path\": [\"/dev/temp\",\"/dev/hum\"] } ]' ``` - Subscribe to `/dev` resource of endpoint named `node-001`. - Subscribe to `Light` type of endpoints and their resources prefixed with `/sen/`. - Subscribe to all observable resources of endpoint names prefixed with `node`. - Subscribe to all observable resources of `Sensor` type endpoints. - Subscribe to `/dev/temp` and `/dev/hum` resources of all endpoints. **Note**: For efficiency reasons, you should use resource path patterns in the pre-subscription data. This prevents the notification flow from unwanted resources. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_pre_subscriptions(presubsription, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param PresubscriptionArray presubsription: Array of pre-subscriptions. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('asynchronous'):
return self.update_pre_subscriptions_with_http_info(presubsription, **kwargs) # noqa: E501
else:
(data) = self.update_pre_subscriptions_with_http_info(presubsription, **kwargs) # noqa: E501
return data
def update_pre_subscriptions_with_http_info(self, presubsription, **kwargs): # noqa: E501
"""Set pre-subscriptions # noqa: E501
Pre-subscription is a set of rules and patterns put by the application. When an endpoint registers and its ID, type and registered resources match the pre-subscription data, Device Management Connect sends subscription requests to the device automatically. The pattern may include the endpoint ID (optionally having an `*` character at the end), endpoint type, a list of resources or expressions with an `*` character at the end. Subscriptions based on pre-subscriptions are done when device registers or does register update. To remove the pre-subscription data, put an empty array as a rule. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). **Limits**: - The maximum length of the endpoint name and endpoint type is 64 characters. - The maximum length of the resource path is 128 characters. - You can listen to 256 separate resource paths. - The maximum number of pre-subscription entries is 1024. **Example request:** ``` curl -X PUT \\ https://api.us-east-1.mbedcloud.com/v2/subscriptions \\ -H 'authorization: Bearer {api-key}' \\ -H 'content-type: application/json' \\ -d '[ { \"endpoint-name\": \"node-001\", \"resource-path\": [\"/dev\"] }, { \"endpoint-type\": \"Light\", \"resource-path\": [\"/sen/*\"] }, { \"endpoint-name\": \"node*\" }, { \"endpoint-type\": \"Sensor\" }, { \"resource-path\": [\"/dev/temp\",\"/dev/hum\"] } ]' ``` - Subscribe to `/dev` resource of endpoint named `node-001`. - Subscribe to `Light` type of endpoints and their resources prefixed with `/sen/`. - Subscribe to all observable resources of endpoint names prefixed with `node`. - Subscribe to all observable resources of `Sensor` type endpoints. - Subscribe to `/dev/temp` and `/dev/hum` resources of all endpoints. **Note**: For efficiency reasons, you should use resource path patterns in the pre-subscription data. This prevents the notification flow from unwanted resources. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_pre_subscriptions_with_http_info(presubsription, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param PresubscriptionArray presubsription: Array of pre-subscriptions. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['presubsription'] # noqa: E501
all_params.append('asynchronous')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_pre_subscriptions" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'presubsription' is set
if ('presubsription' not in params or
params['presubsription'] is None):
raise ValueError("Missing the required parameter `presubsription` when calling `update_pre_subscriptions`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'presubsription' in params:
body_params = params['presubsription']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['text/plain']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['Bearer'] # noqa: E501
return self.api_client.call_api(
'/v2/subscriptions', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
asynchronous=params.get('asynchronous'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
|
class SubscriptionsApi(object):
'''NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
'''
def __init__(self, api_client=None):
pass
def add_resource_subscription(self, device_id, _resource_path, **kwargs):
'''Subscribe to a resource path # noqa: E501
The Device Management Connect eventing model consists of observable resources. This means that endpoints can deliver updated resource content, periodically or with a more sophisticated solution-dependent logic. The OMA LwM2M resource model including objects, object instances, resources and resource instances is also supported. Applications can subscribe to objects, object instances or individual resources to make the device to provide value change notifications to Device Management Connect service. An application needs to call a `/notification/callback` method to get Device Management Connect to push notifications of the resource changes. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). All manual subscriptions are removed during a full device registration and applications need to re-subscribe at that point. To avoid this, you can use `/subscriptions` to set a pre-subscription. **Example usage:** curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.add_resource_subscription(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def add_resource_subscription_with_http_info(self, device_id, _resource_path, **kwargs):
'''Subscribe to a resource path # noqa: E501
The Device Management Connect eventing model consists of observable resources. This means that endpoints can deliver updated resource content, periodically or with a more sophisticated solution-dependent logic. The OMA LwM2M resource model including objects, object instances, resources and resource instances is also supported. Applications can subscribe to objects, object instances or individual resources to make the device to provide value change notifications to Device Management Connect service. An application needs to call a `/notification/callback` method to get Device Management Connect to push notifications of the resource changes. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). All manual subscriptions are removed during a full device registration and applications need to re-subscribe at that point. To avoid this, you can use `/subscriptions` to set a pre-subscription. **Example usage:** curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.add_resource_subscription_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def check_resource_subscription(self, device_id, _resource_path, **kwargs):
'''Read subscription status # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.check_resource_subscription(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def check_resource_subscription_with_http_info(self, device_id, _resource_path, **kwargs):
'''Read subscription status # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.check_resource_subscription_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_endpoint_subscriptions(self, device_id, **kwargs):
'''Delete subscriptions from an endpoint # noqa: E501
Deletes all resource subscriptions in a single endpoint. **Example usage:** curl -X DELETE \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_endpoint_subscriptions(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_endpoint_subscriptions_with_http_info(self, device_id, **kwargs):
'''Delete subscriptions from an endpoint # noqa: E501
Deletes all resource subscriptions in a single endpoint. **Example usage:** curl -X DELETE \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_endpoint_subscriptions_with_http_info(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_pre_subscriptions(self, **kwargs):
'''Remove pre-subscriptions # noqa: E501
Removes pre-subscriptions. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_pre_subscriptions(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_pre_subscriptions_with_http_info(self, **kwargs):
'''Remove pre-subscriptions # noqa: E501
Removes pre-subscriptions. **Example usage:** curl -X DELETE https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_pre_subscriptions_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_resource_subscription(self, device_id, _resource_path, **kwargs):
'''Remove a subscription # noqa: E501
To remove an existing subscription from a resource path. **Example usage:** curl -X DELETE \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_subscription(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def delete_resource_subscription_with_http_info(self, device_id, _resource_path, **kwargs):
'''Remove a subscription # noqa: E501
To remove an existing subscription from a resource path. **Example usage:** curl -X DELETE \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id}/{resourcePath} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.delete_resource_subscription_with_http_info(device_id, _resource_path, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that the ID must be an exact match. You cannot use wildcards here. (required)
:param str _resource_path: The URL of the resource. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_endpoint_subscriptions(self, device_id, **kwargs):
'''Read endpoints subscriptions # noqa: E501
Lists all subscribed resources from a single endpoint. **Example usage:** curl -X GET \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_subscriptions(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that ID must be an exact match. You cannot use wildcards here. (required)
:return: str
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_endpoint_subscriptions_with_http_info(self, device_id, **kwargs):
'''Read endpoints subscriptions # noqa: E501
Lists all subscribed resources from a single endpoint. **Example usage:** curl -X GET \ https://api.us-east-1.mbedcloud.com/v2/subscriptions/{device-id} \ -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_endpoint_subscriptions_with_http_info(device_id, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param str device_id: A unique Device Management device ID for the endpoint. Note that ID must be an exact match. You cannot use wildcards here. (required)
:return: str
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_pre_subscriptions(self, **kwargs):
'''Get pre-subscriptions # noqa: E501
You can retrieve the pre-subscription data with the GET operation. The server returns with the same JSON structure as described above. If there are no pre-subscribed resources, it returns with an empty array. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_pre_subscriptions(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: PresubscriptionArray
If the method is called asynchronously,
returns the request thread.
'''
pass
def get_pre_subscriptions_with_http_info(self, **kwargs):
'''Get pre-subscriptions # noqa: E501
You can retrieve the pre-subscription data with the GET operation. The server returns with the same JSON structure as described above. If there are no pre-subscribed resources, it returns with an empty array. **Example usage:** curl -X GET https://api.us-east-1.mbedcloud.com/v2/subscriptions -H 'authorization: Bearer {api-key}' # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.get_pre_subscriptions_with_http_info(asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:return: PresubscriptionArray
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_pre_subscriptions(self, presubsription, **kwargs):
'''Set pre-subscriptions # noqa: E501
Pre-subscription is a set of rules and patterns put by the application. When an endpoint registers and its ID, type and registered resources match the pre-subscription data, Device Management Connect sends subscription requests to the device automatically. The pattern may include the endpoint ID (optionally having an `*` character at the end), endpoint type, a list of resources or expressions with an `*` character at the end. Subscriptions based on pre-subscriptions are done when device registers or does register update. To remove the pre-subscription data, put an empty array as a rule. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). **Limits**: - The maximum length of the endpoint name and endpoint type is 64 characters. - The maximum length of the resource path is 128 characters. - You can listen to 256 separate resource paths. - The maximum number of pre-subscription entries is 1024. **Example request:** ``` curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/subscriptions \ -H 'authorization: Bearer {api-key}' \ -H 'content-type: application/json' \ -d '[ { "endpoint-name": "node-001", "resource-path": ["/dev"] }, { "endpoint-type": "Light", "resource-path": ["/sen/*"] }, { "endpoint-name": "node*" }, { "endpoint-type": "Sensor" }, { "resource-path": ["/dev/temp","/dev/hum"] } ]' ``` - Subscribe to `/dev` resource of endpoint named `node-001`. - Subscribe to `Light` type of endpoints and their resources prefixed with `/sen/`. - Subscribe to all observable resources of endpoint names prefixed with `node`. - Subscribe to all observable resources of `Sensor` type endpoints. - Subscribe to `/dev/temp` and `/dev/hum` resources of all endpoints. **Note**: For efficiency reasons, you should use resource path patterns in the pre-subscription data. This prevents the notification flow from unwanted resources. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_pre_subscriptions(presubsription, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param PresubscriptionArray presubsription: Array of pre-subscriptions. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
def update_pre_subscriptions_with_http_info(self, presubsription, **kwargs):
'''Set pre-subscriptions # noqa: E501
Pre-subscription is a set of rules and patterns put by the application. When an endpoint registers and its ID, type and registered resources match the pre-subscription data, Device Management Connect sends subscription requests to the device automatically. The pattern may include the endpoint ID (optionally having an `*` character at the end), endpoint type, a list of resources or expressions with an `*` character at the end. Subscriptions based on pre-subscriptions are done when device registers or does register update. To remove the pre-subscription data, put an empty array as a rule. **Notification rules** A web application can place dynamic observation rules for individual Object Instances and Resources to define when the device sends observations. More information in [Notification rules](/docs/current/connecting/resource-change-webapp.html). **Limits**: - The maximum length of the endpoint name and endpoint type is 64 characters. - The maximum length of the resource path is 128 characters. - You can listen to 256 separate resource paths. - The maximum number of pre-subscription entries is 1024. **Example request:** ``` curl -X PUT \ https://api.us-east-1.mbedcloud.com/v2/subscriptions \ -H 'authorization: Bearer {api-key}' \ -H 'content-type: application/json' \ -d '[ { "endpoint-name": "node-001", "resource-path": ["/dev"] }, { "endpoint-type": "Light", "resource-path": ["/sen/*"] }, { "endpoint-name": "node*" }, { "endpoint-type": "Sensor" }, { "resource-path": ["/dev/temp","/dev/hum"] } ]' ``` - Subscribe to `/dev` resource of endpoint named `node-001`. - Subscribe to `Light` type of endpoints and their resources prefixed with `/sen/`. - Subscribe to all observable resources of endpoint names prefixed with `node`. - Subscribe to all observable resources of `Sensor` type endpoints. - Subscribe to `/dev/temp` and `/dev/hum` resources of all endpoints. **Note**: For efficiency reasons, you should use resource path patterns in the pre-subscription data. This prevents the notification flow from unwanted resources. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thread = api.update_pre_subscriptions_with_http_info(presubsription, asynchronous=True)
>>> result = thread.get()
:param asynchronous bool
:param PresubscriptionArray presubsription: Array of pre-subscriptions. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
'''
pass
| 18 | 17 | 44 | 6 | 25 | 17 | 4 | 0.71 | 1 | 3 | 1 | 0 | 17 | 1 | 17 | 17 | 765 | 127 | 420 | 115 | 402 | 297 | 262 | 115 | 244 | 7 | 1 | 2 | 60 |
2,594 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/models/subscriptions_list.py
|
mbed_cloud._backends.mds.models.subscriptions_list.SubscriptionsList
|
class SubscriptionsList(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
}
attribute_map = {
}
def __init__(self):
"""
SubscriptionsList - a model defined in Swagger
"""
self.discriminator = None
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, SubscriptionsList):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class SubscriptionsList(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self):
'''
SubscriptionsList - a model defined in Swagger
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 7 | 7 | 9 | 1 | 5 | 3 | 2 | 0.78 | 1 | 3 | 0 | 0 | 6 | 1 | 6 | 6 | 81 | 15 | 37 | 13 | 30 | 29 | 25 | 13 | 18 | 5 | 1 | 2 | 11 |
2,595 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/models/resource_path.py
|
mbed_cloud._backends.mds.models.resource_path.ResourcePath
|
class ResourcePath(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
}
attribute_map = {
}
def __init__(self):
"""
ResourcePath - a model defined in Swagger
"""
self.discriminator = None
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ResourcePath):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class ResourcePath(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self):
'''
ResourcePath - a model defined in Swagger
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 7 | 7 | 9 | 1 | 5 | 3 | 2 | 0.78 | 1 | 3 | 0 | 0 | 6 | 1 | 6 | 6 | 81 | 15 | 37 | 13 | 30 | 29 | 25 | 13 | 18 | 5 | 1 | 2 | 11 |
2,596 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/models/resource.py
|
mbed_cloud._backends.mds.models.resource.Resource
|
class Resource(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'obs': 'bool',
'rt': 'str',
'type': 'str',
'uri': 'str'
}
attribute_map = {
'obs': 'obs',
'rt': 'rt',
'type': 'type',
'uri': 'uri'
}
def __init__(self, obs=None, rt=None, type=None, uri=None):
"""
Resource - a model defined in Swagger
"""
self._obs = obs
self._rt = rt
self._type = type
self._uri = uri
self.discriminator = None
@property
def obs(self):
"""
Gets the obs of this Resource.
Observable determines whether you can subscribe to changes for this resource. It can have values \"true\" or \"false\".
:return: The obs of this Resource.
:rtype: bool
"""
return self._obs
@obs.setter
def obs(self, obs):
"""
Sets the obs of this Resource.
Observable determines whether you can subscribe to changes for this resource. It can have values \"true\" or \"false\".
:param obs: The obs of this Resource.
:type: bool
"""
self._obs = obs
@property
def rt(self):
"""
Gets the rt of this Resource.
Application specific resource type that describes this resource. [It is created by the client side application](/docs/current/connecting/resource-setup-in-mbed-cloud-client.html). Not meant to be a human-readable name for the resource. Multiple resource types may be included, they are separated by a space.
:return: The rt of this Resource.
:rtype: str
"""
return self._rt
@rt.setter
def rt(self, rt):
"""
Sets the rt of this Resource.
Application specific resource type that describes this resource. [It is created by the client side application](/docs/current/connecting/resource-setup-in-mbed-cloud-client.html). Not meant to be a human-readable name for the resource. Multiple resource types may be included, they are separated by a space.
:param rt: The rt of this Resource.
:type: str
"""
self._rt = rt
@property
def type(self):
"""
Gets the type of this Resource.
The content type of the resource. <br/><br/><b>Important</b><br/> You are encouraged to use the resource types listed in the [LwM2M specification](http://technical.openmobilealliance.org/Technical/technical-information/omna/lightweight-m2m-lwm2m-object-registry).
:return: The type of this Resource.
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""
Sets the type of this Resource.
The content type of the resource. <br/><br/><b>Important</b><br/> You are encouraged to use the resource types listed in the [LwM2M specification](http://technical.openmobilealliance.org/Technical/technical-information/omna/lightweight-m2m-lwm2m-object-registry).
:param type: The type of this Resource.
:type: str
"""
self._type = type
@property
def uri(self):
"""
Gets the uri of this Resource.
The URL of the resource.
:return: The uri of this Resource.
:rtype: str
"""
return self._uri
@uri.setter
def uri(self, uri):
"""
Sets the uri of this Resource.
The URL of the resource.
:param uri: The uri of this Resource.
:type: str
"""
if uri is None:
raise ValueError("Invalid value for `uri`, must not be `None`")
self._uri = uri
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Resource):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class Resource(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, obs=None, rt=None, type=None, uri=None):
'''
Resource - a model defined in Swagger
'''
pass
@property
def obs(self):
'''
Gets the obs of this Resource.
Observable determines whether you can subscribe to changes for this resource. It can have values "true" or "false".
:return: The obs of this Resource.
:rtype: bool
'''
pass
@obs.setter
def obs(self):
'''
Sets the obs of this Resource.
Observable determines whether you can subscribe to changes for this resource. It can have values "true" or "false".
:param obs: The obs of this Resource.
:type: bool
'''
pass
@property
def rt(self):
'''
Gets the rt of this Resource.
Application specific resource type that describes this resource. [It is created by the client side application](/docs/current/connecting/resource-setup-in-mbed-cloud-client.html). Not meant to be a human-readable name for the resource. Multiple resource types may be included, they are separated by a space.
:return: The rt of this Resource.
:rtype: str
'''
pass
@rt.setter
def rt(self):
'''
Sets the rt of this Resource.
Application specific resource type that describes this resource. [It is created by the client side application](/docs/current/connecting/resource-setup-in-mbed-cloud-client.html). Not meant to be a human-readable name for the resource. Multiple resource types may be included, they are separated by a space.
:param rt: The rt of this Resource.
:type: str
'''
pass
@property
def type(self):
'''
Gets the type of this Resource.
The content type of the resource. <br/><br/><b>Important</b><br/> You are encouraged to use the resource types listed in the [LwM2M specification](http://technical.openmobilealliance.org/Technical/technical-information/omna/lightweight-m2m-lwm2m-object-registry).
:return: The type of this Resource.
:rtype: str
'''
pass
@type.setter
def type(self):
'''
Sets the type of this Resource.
The content type of the resource. <br/><br/><b>Important</b><br/> You are encouraged to use the resource types listed in the [LwM2M specification](http://technical.openmobilealliance.org/Technical/technical-information/omna/lightweight-m2m-lwm2m-object-registry).
:param type: The type of this Resource.
:type: str
'''
pass
@property
def uri(self):
'''
Gets the uri of this Resource.
The URL of the resource.
:return: The uri of this Resource.
:rtype: str
'''
pass
@uri.setter
def uri(self):
'''
Sets the uri of this Resource.
The URL of the resource.
:param uri: The uri of this Resource.
:type: str
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 23 | 15 | 10 | 1 | 4 | 5 | 1 | 1.03 | 1 | 4 | 0 | 0 | 14 | 5 | 14 | 14 | 185 | 33 | 75 | 33 | 52 | 77 | 47 | 25 | 32 | 5 | 1 | 2 | 20 |
2,597 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/models/presubscription_array.py
|
mbed_cloud._backends.mds.models.presubscription_array.PresubscriptionArray
|
class PresubscriptionArray(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
}
attribute_map = {
}
def __init__(self):
"""
PresubscriptionArray - a model defined in Swagger
"""
self.discriminator = None
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, PresubscriptionArray):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class PresubscriptionArray(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self):
'''
PresubscriptionArray - a model defined in Swagger
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 7 | 7 | 9 | 1 | 5 | 3 | 2 | 0.78 | 1 | 3 | 0 | 0 | 6 | 1 | 6 | 6 | 81 | 15 | 37 | 13 | 30 | 29 | 25 | 13 | 18 | 5 | 1 | 2 | 11 |
2,598 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/models/presubscription.py
|
mbed_cloud._backends.mds.models.presubscription.Presubscription
|
class Presubscription(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'endpoint_name': 'str',
'endpoint_type': 'str',
'_resource_path': 'list[str]'
}
attribute_map = {
'endpoint_name': 'endpoint-name',
'endpoint_type': 'endpoint-type',
'_resource_path': 'resource-path'
}
def __init__(self, endpoint_name=None, endpoint_type=None, _resource_path=None):
"""
Presubscription - a model defined in Swagger
"""
self._endpoint_name = endpoint_name
self._endpoint_type = endpoint_type
self.__resource_path = _resource_path
self.discriminator = None
@property
def endpoint_name(self):
"""
Gets the endpoint_name of this Presubscription.
The device ID.
:return: The endpoint_name of this Presubscription.
:rtype: str
"""
return self._endpoint_name
@endpoint_name.setter
def endpoint_name(self, endpoint_name):
"""
Sets the endpoint_name of this Presubscription.
The device ID.
:param endpoint_name: The endpoint_name of this Presubscription.
:type: str
"""
self._endpoint_name = endpoint_name
@property
def endpoint_type(self):
"""
Gets the endpoint_type of this Presubscription.
:return: The endpoint_type of this Presubscription.
:rtype: str
"""
return self._endpoint_type
@endpoint_type.setter
def endpoint_type(self, endpoint_type):
"""
Sets the endpoint_type of this Presubscription.
:param endpoint_type: The endpoint_type of this Presubscription.
:type: str
"""
self._endpoint_type = endpoint_type
@property
def _resource_path(self):
"""
Gets the _resource_path of this Presubscription.
:return: The _resource_path of this Presubscription.
:rtype: list[str]
"""
return self.__resource_path
@_resource_path.setter
def _resource_path(self, _resource_path):
"""
Sets the _resource_path of this Presubscription.
:param _resource_path: The _resource_path of this Presubscription.
:type: list[str]
"""
self.__resource_path = _resource_path
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Presubscription):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class Presubscription(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, endpoint_name=None, endpoint_type=None, _resource_path=None):
'''
Presubscription - a model defined in Swagger
'''
pass
@property
def endpoint_name(self):
'''
Gets the endpoint_name of this Presubscription.
The device ID.
:return: The endpoint_name of this Presubscription.
:rtype: str
'''
pass
@endpoint_name.setter
def endpoint_name(self):
'''
Sets the endpoint_name of this Presubscription.
The device ID.
:param endpoint_name: The endpoint_name of this Presubscription.
:type: str
'''
pass
@property
def endpoint_type(self):
'''
Gets the endpoint_type of this Presubscription.
:return: The endpoint_type of this Presubscription.
:rtype: str
'''
pass
@endpoint_type.setter
def endpoint_type(self):
'''
Sets the endpoint_type of this Presubscription.
:param endpoint_type: The endpoint_type of this Presubscription.
:type: str
'''
pass
@property
def _resource_path(self):
'''
Gets the _resource_path of this Presubscription.
:return: The _resource_path of this Presubscription.
:rtype: list[str]
'''
pass
@_resource_path.setter
def _resource_path(self):
'''
Sets the _resource_path of this Presubscription.
:param _resource_path: The _resource_path of this Presubscription.
:type: list[str]
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 19 | 13 | 9 | 1 | 4 | 4 | 1 | 0.95 | 1 | 3 | 0 | 0 | 12 | 4 | 12 | 12 | 153 | 28 | 64 | 28 | 45 | 61 | 40 | 22 | 27 | 5 | 1 | 2 | 17 |
2,599 |
ARMmbed/mbed-cloud-sdk-python
|
ARMmbed_mbed-cloud-sdk-python/src/mbed_cloud/_backends/mds/models/notification_message.py
|
mbed_cloud._backends.mds.models.notification_message.NotificationMessage
|
class NotificationMessage(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'async_responses': 'list[AsyncIDResponse]',
'de_registrations': 'list[str]',
'notifications': 'list[NotificationData]',
'reg_updates': 'list[EndpointData]',
'registrations': 'list[EndpointData]',
'registrations_expired': 'list[str]'
}
attribute_map = {
'async_responses': 'async-responses',
'de_registrations': 'de-registrations',
'notifications': 'notifications',
'reg_updates': 'reg-updates',
'registrations': 'registrations',
'registrations_expired': 'registrations-expired'
}
def __init__(self, async_responses=None, de_registrations=None, notifications=None, reg_updates=None, registrations=None, registrations_expired=None):
"""
NotificationMessage - a model defined in Swagger
"""
self._async_responses = async_responses
self._de_registrations = de_registrations
self._notifications = notifications
self._reg_updates = reg_updates
self._registrations = registrations
self._registrations_expired = registrations_expired
self.discriminator = None
@property
def async_responses(self):
"""
Gets the async_responses of this NotificationMessage.
:return: The async_responses of this NotificationMessage.
:rtype: list[AsyncIDResponse]
"""
return self._async_responses
@async_responses.setter
def async_responses(self, async_responses):
"""
Sets the async_responses of this NotificationMessage.
:param async_responses: The async_responses of this NotificationMessage.
:type: list[AsyncIDResponse]
"""
self._async_responses = async_responses
@property
def de_registrations(self):
"""
Gets the de_registrations of this NotificationMessage.
:return: The de_registrations of this NotificationMessage.
:rtype: list[str]
"""
return self._de_registrations
@de_registrations.setter
def de_registrations(self, de_registrations):
"""
Sets the de_registrations of this NotificationMessage.
:param de_registrations: The de_registrations of this NotificationMessage.
:type: list[str]
"""
self._de_registrations = de_registrations
@property
def notifications(self):
"""
Gets the notifications of this NotificationMessage.
:return: The notifications of this NotificationMessage.
:rtype: list[NotificationData]
"""
return self._notifications
@notifications.setter
def notifications(self, notifications):
"""
Sets the notifications of this NotificationMessage.
:param notifications: The notifications of this NotificationMessage.
:type: list[NotificationData]
"""
self._notifications = notifications
@property
def reg_updates(self):
"""
Gets the reg_updates of this NotificationMessage.
:return: The reg_updates of this NotificationMessage.
:rtype: list[EndpointData]
"""
return self._reg_updates
@reg_updates.setter
def reg_updates(self, reg_updates):
"""
Sets the reg_updates of this NotificationMessage.
:param reg_updates: The reg_updates of this NotificationMessage.
:type: list[EndpointData]
"""
self._reg_updates = reg_updates
@property
def registrations(self):
"""
Gets the registrations of this NotificationMessage.
:return: The registrations of this NotificationMessage.
:rtype: list[EndpointData]
"""
return self._registrations
@registrations.setter
def registrations(self, registrations):
"""
Sets the registrations of this NotificationMessage.
:param registrations: The registrations of this NotificationMessage.
:type: list[EndpointData]
"""
self._registrations = registrations
@property
def registrations_expired(self):
"""
Gets the registrations_expired of this NotificationMessage.
:return: The registrations_expired of this NotificationMessage.
:rtype: list[str]
"""
return self._registrations_expired
@registrations_expired.setter
def registrations_expired(self, registrations_expired):
"""
Sets the registrations_expired of this NotificationMessage.
:param registrations_expired: The registrations_expired of this NotificationMessage.
:type: list[str]
"""
self._registrations_expired = registrations_expired
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, NotificationMessage):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
|
class NotificationMessage(object):
'''
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
'''
def __init__(self, async_responses=None, de_registrations=None, notifications=None, reg_updates=None, registrations=None, registrations_expired=None):
'''
NotificationMessage - a model defined in Swagger
'''
pass
@property
def async_responses(self):
'''
Gets the async_responses of this NotificationMessage.
:return: The async_responses of this NotificationMessage.
:rtype: list[AsyncIDResponse]
'''
pass
@async_responses.setter
def async_responses(self):
'''
Sets the async_responses of this NotificationMessage.
:param async_responses: The async_responses of this NotificationMessage.
:type: list[AsyncIDResponse]
'''
pass
@property
def de_registrations(self):
'''
Gets the de_registrations of this NotificationMessage.
:return: The de_registrations of this NotificationMessage.
:rtype: list[str]
'''
pass
@de_registrations.setter
def de_registrations(self):
'''
Sets the de_registrations of this NotificationMessage.
:param de_registrations: The de_registrations of this NotificationMessage.
:type: list[str]
'''
pass
@property
def notifications(self):
'''
Gets the notifications of this NotificationMessage.
:return: The notifications of this NotificationMessage.
:rtype: list[NotificationData]
'''
pass
@notifications.setter
def notifications(self):
'''
Sets the notifications of this NotificationMessage.
:param notifications: The notifications of this NotificationMessage.
:type: list[NotificationData]
'''
pass
@property
def reg_updates(self):
'''
Gets the reg_updates of this NotificationMessage.
:return: The reg_updates of this NotificationMessage.
:rtype: list[EndpointData]
'''
pass
@reg_updates.setter
def reg_updates(self):
'''
Sets the reg_updates of this NotificationMessage.
:param reg_updates: The reg_updates of this NotificationMessage.
:type: list[EndpointData]
'''
pass
@property
def registrations(self):
'''
Gets the registrations of this NotificationMessage.
:return: The registrations of this NotificationMessage.
:rtype: list[EndpointData]
'''
pass
@registrations.setter
def registrations(self):
'''
Sets the registrations of this NotificationMessage.
:param registrations: The registrations of this NotificationMessage.
:type: list[EndpointData]
'''
pass
@property
def registrations_expired(self):
'''
Gets the registrations_expired of this NotificationMessage.
:return: The registrations_expired of this NotificationMessage.
:rtype: list[str]
'''
pass
@registrations_expired.setter
def registrations_expired(self):
'''
Sets the registrations_expired of this NotificationMessage.
:param registrations_expired: The registrations_expired of this NotificationMessage.
:type: list[str]
'''
pass
def to_dict(self):
'''
Returns the model properties as a dict
'''
pass
def to_str(self):
'''
Returns the string representation of the model
'''
pass
def __repr__(self):
'''
For `print` and `pprint`
'''
pass
def __eq__(self, other):
'''
Returns true if both objects are equal
'''
pass
def __ne__(self, other):
'''
Returns true if both objects are not equal
'''
pass
| 31 | 19 | 9 | 1 | 3 | 4 | 1 | 0.98 | 1 | 3 | 0 | 0 | 18 | 7 | 18 | 18 | 223 | 43 | 91 | 43 | 60 | 89 | 55 | 31 | 36 | 5 | 1 | 2 | 23 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.