1+ # coding: utf-8
2+ # -----------------------------------------------------------------------------------
3+ # <copyright company="Aspose" file="public_key_response.py">
4+ # Copyright (c) 2021 Aspose.Words for Cloud
5+ # </copyright>
6+ # <summary>
7+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8+ # of this software and associated documentation files (the "Software"), to deal
9+ # in the Software without restriction, including without limitation the rights
10+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+ # copies of the Software, and to permit persons to whom the Software is
12+ # furnished to do so, subject to the following conditions:
13+ #
14+ # The above copyright notice and this permission notice shall be included in all
15+ # copies or substantial portions of the Software.
16+ #
17+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+ # SOFTWARE.
24+ # </summary>
25+ # -----------------------------------------------------------------------------------
26+ import pprint
27+ import re # noqa: F401
28+
29+ import datetime
30+ import six
31+ import json
32+
33+
34+ class PublicKeyResponse (object ):
35+ """REST response for RSA public key info.
36+ """
37+
38+ """
39+ Attributes:
40+ swagger_types (dict): The key is attribute name
41+ and the value is attribute type.
42+ attribute_map (dict): The key is attribute name
43+ and the value is json key in definition.
44+ """
45+ swagger_types = {
46+ 'request_id' : 'str' ,
47+ 'exponent' : 'str' ,
48+ 'modulus' : 'str'
49+ }
50+
51+ attribute_map = {
52+ 'request_id' : 'RequestId' ,
53+ 'exponent' : 'Exponent' ,
54+ 'modulus' : 'Modulus'
55+ }
56+
57+ def __init__ (self , request_id = None , exponent = None , modulus = None ): # noqa: E501
58+ """PublicKeyResponse - a model defined in Swagger""" # noqa: E501
59+
60+ self ._request_id = None
61+ self ._exponent = None
62+ self ._modulus = None
63+ self .discriminator = None
64+
65+ if request_id is not None :
66+ self .request_id = request_id
67+ if exponent is not None :
68+ self .exponent = exponent
69+ if modulus is not None :
70+ self .modulus = modulus
71+
72+ @property
73+ def request_id (self ):
74+ """Gets the request_id of this PublicKeyResponse. # noqa: E501
75+
76+ Gets or sets the request Id. # noqa: E501
77+
78+ :return: The request_id of this PublicKeyResponse. # noqa: E501
79+ :rtype: str
80+ """
81+ return self ._request_id
82+
83+ @request_id .setter
84+ def request_id (self , request_id ):
85+ """Sets the request_id of this PublicKeyResponse.
86+
87+ Gets or sets the request Id. # noqa: E501
88+
89+ :param request_id: The request_id of this PublicKeyResponse. # noqa: E501
90+ :type: str
91+ """
92+ self ._request_id = request_id
93+
94+ @property
95+ def exponent (self ):
96+ """Gets the exponent of this PublicKeyResponse. # noqa: E501
97+
98+ Gets or sets RSA key exponent as Base64 string. # noqa: E501
99+
100+ :return: The exponent of this PublicKeyResponse. # noqa: E501
101+ :rtype: str
102+ """
103+ return self ._exponent
104+
105+ @exponent .setter
106+ def exponent (self , exponent ):
107+ """Sets the exponent of this PublicKeyResponse.
108+
109+ Gets or sets RSA key exponent as Base64 string. # noqa: E501
110+
111+ :param exponent: The exponent of this PublicKeyResponse. # noqa: E501
112+ :type: str
113+ """
114+ self ._exponent = exponent
115+
116+ @property
117+ def modulus (self ):
118+ """Gets the modulus of this PublicKeyResponse. # noqa: E501
119+
120+ Gets or sets RSA key modulus as Base64 string. # noqa: E501
121+
122+ :return: The modulus of this PublicKeyResponse. # noqa: E501
123+ :rtype: str
124+ """
125+ return self ._modulus
126+
127+ @modulus .setter
128+ def modulus (self , modulus ):
129+ """Sets the modulus of this PublicKeyResponse.
130+
131+ Gets or sets RSA key modulus as Base64 string. # noqa: E501
132+
133+ :param modulus: The modulus of this PublicKeyResponse. # noqa: E501
134+ :type: str
135+ """
136+ self ._modulus = modulus
137+
138+
139+ def to_dict (self ):
140+ """Returns the model properties as a dict"""
141+ result = {}
142+
143+ for attr , _ in six .iteritems (self .swagger_types ):
144+ value = getattr (self , attr )
145+ if value is None :
146+ continue
147+ if isinstance (value , list ):
148+ result [self .attribute_map [attr ]] = list (map (
149+ lambda x : x .to_dict () if hasattr (x , "to_dict" ) else x ,
150+ value
151+ ))
152+ elif hasattr (value , "to_dict" ):
153+ result [self .attribute_map [attr ]] = value .to_dict ()
154+ elif isinstance (value , dict ):
155+ result [self .attribute_map [attr ]] = dict (map (
156+ lambda item : (item [0 ], item [1 ].to_dict ())
157+ if hasattr (item [1 ], "to_dict" ) else item ,
158+ value .items ()
159+ ))
160+ elif isinstance (value , (datetime .datetime , datetime .date )):
161+ result [self .attribute_map [attr ]] = value .isoformat ()
162+ else :
163+ result [self .attribute_map [attr ]] = value
164+
165+ return result
166+
167+ def to_json (self ):
168+ """Returns the model properties as a dict"""
169+ result = {}
170+
171+ for attr , _ in six .iteritems (self .swagger_types ):
172+ value = getattr (self , attr )
173+ if isinstance (value , list ):
174+ result [self .attribute_map [attr ]] = list (map (
175+ lambda x : x .to_dict () if hasattr (x , "to_dict" ) else x ,
176+ value
177+ ))
178+ elif hasattr (value , "to_dict" ):
179+ result [self .attribute_map [attr ]] = value .to_dict ()
180+ elif isinstance (value , dict ):
181+ result [self .attribute_map [attr ]] = dict (map (
182+ lambda item : (item [0 ], item [1 ].to_dict ())
183+ if hasattr (item [1 ], "to_dict" ) else item ,
184+ value .items ()
185+ ))
186+ elif isinstance (value , (datetime .datetime , datetime .date )):
187+ result [self .attribute_map [attr ]] = value .isoformat ()
188+ else :
189+ result [self .attribute_map [attr ]] = value
190+
191+ return json .dumps (result )
192+
193+ def to_str (self ):
194+ """Returns the string representation of the model"""
195+ return pprint .pformat (self .to_dict ())
196+
197+ def __repr__ (self ):
198+ """For `print` and `pprint`"""
199+ return self .to_str ()
200+
201+ def __eq__ (self , other ):
202+ """Returns true if both objects are equal"""
203+ if not isinstance (other , PublicKeyResponse ):
204+ return False
205+
206+ return self .__dict__ == other .__dict__
207+
208+ def __ne__ (self , other ):
209+ """Returns true if both objects are not equal"""
210+ return not self == other
0 commit comments