3
3
# @generated
4
4
# flake8: noqa
5
5
# pylint: skip-file
6
- try :
7
- from . import stone_validators as bv
8
- from . import stone_base as bb
9
- except (ImportError , SystemError , ValueError ):
10
- # Catch errors raised when importing a relative module when not in a package.
11
- # This makes testing this file directly (outside of a package) easier.
12
- import stone_validators as bv
13
- import stone_base as bb
6
+ from __future__ import unicode_literals
7
+ from stone .backends .python_rsrc import stone_base as bb
8
+ from stone .backends .python_rsrc import stone_validators as bv
14
9
15
10
class PhotoSourceArg (bb .Union ):
16
11
"""
@@ -68,9 +63,6 @@ def get_base64_data(self):
68
63
def _process_custom_annotations (self , annotation_type , field_path , processor ):
69
64
super (PhotoSourceArg , self )._process_custom_annotations (annotation_type , field_path , processor )
70
65
71
- def __repr__ (self ):
72
- return 'PhotoSourceArg(%r, %r)' % (self ._tag , self ._value )
73
-
74
66
PhotoSourceArg_validator = bv .Union (PhotoSourceArg )
75
67
76
68
class SetProfilePhotoArg (bb .Struct ):
@@ -81,49 +73,22 @@ class SetProfilePhotoArg(bb.Struct):
81
73
82
74
__slots__ = [
83
75
'_photo_value' ,
84
- '_photo_present' ,
85
76
]
86
77
87
78
_has_required_fields = True
88
79
89
80
def __init__ (self ,
90
81
photo = None ):
91
- self ._photo_value = None
92
- self ._photo_present = False
82
+ self ._photo_value = bb .NOT_SET
93
83
if photo is not None :
94
84
self .photo = photo
95
85
96
- @property
97
- def photo (self ):
98
- """
99
- Image to set as the user's new profile photo.
100
-
101
- :rtype: PhotoSourceArg
102
- """
103
- if self ._photo_present :
104
- return self ._photo_value
105
- else :
106
- raise AttributeError ("missing required field 'photo'" )
107
-
108
- @photo .setter
109
- def photo (self , val ):
110
- self ._photo_validator .validate_type_only (val )
111
- self ._photo_value = val
112
- self ._photo_present = True
113
-
114
- @photo .deleter
115
- def photo (self ):
116
- self ._photo_value = None
117
- self ._photo_present = False
86
+ # Instance attribute type: PhotoSourceArg (validator is set below)
87
+ photo = bb .Attribute ("photo" , user_defined = True )
118
88
119
89
def _process_custom_annotations (self , annotation_type , field_path , processor ):
120
90
super (SetProfilePhotoArg , self )._process_custom_annotations (annotation_type , field_path , processor )
121
91
122
- def __repr__ (self ):
123
- return 'SetProfilePhotoArg(photo={!r})' .format (
124
- self ._photo_value ,
125
- )
126
-
127
92
SetProfilePhotoArg_validator = bv .Struct (SetProfilePhotoArg )
128
93
129
94
class SetProfilePhotoError (bb .Union ):
@@ -209,9 +174,6 @@ def is_other(self):
209
174
def _process_custom_annotations (self , annotation_type , field_path , processor ):
210
175
super (SetProfilePhotoError , self )._process_custom_annotations (annotation_type , field_path , processor )
211
176
212
- def __repr__ (self ):
213
- return 'SetProfilePhotoError(%r, %r)' % (self ._tag , self ._value )
214
-
215
177
SetProfilePhotoError_validator = bv .Union (SetProfilePhotoError )
216
178
217
179
class SetProfilePhotoResult (bb .Struct ):
@@ -222,49 +184,22 @@ class SetProfilePhotoResult(bb.Struct):
222
184
223
185
__slots__ = [
224
186
'_profile_photo_url_value' ,
225
- '_profile_photo_url_present' ,
226
187
]
227
188
228
189
_has_required_fields = True
229
190
230
191
def __init__ (self ,
231
192
profile_photo_url = None ):
232
- self ._profile_photo_url_value = None
233
- self ._profile_photo_url_present = False
193
+ self ._profile_photo_url_value = bb .NOT_SET
234
194
if profile_photo_url is not None :
235
195
self .profile_photo_url = profile_photo_url
236
196
237
- @property
238
- def profile_photo_url (self ):
239
- """
240
- URL for the photo representing the user, if one is set.
241
-
242
- :rtype: str
243
- """
244
- if self ._profile_photo_url_present :
245
- return self ._profile_photo_url_value
246
- else :
247
- raise AttributeError ("missing required field 'profile_photo_url'" )
248
-
249
- @profile_photo_url .setter
250
- def profile_photo_url (self , val ):
251
- val = self ._profile_photo_url_validator .validate (val )
252
- self ._profile_photo_url_value = val
253
- self ._profile_photo_url_present = True
254
-
255
- @profile_photo_url .deleter
256
- def profile_photo_url (self ):
257
- self ._profile_photo_url_value = None
258
- self ._profile_photo_url_present = False
197
+ # Instance attribute type: str (validator is set below)
198
+ profile_photo_url = bb .Attribute ("profile_photo_url" )
259
199
260
200
def _process_custom_annotations (self , annotation_type , field_path , processor ):
261
201
super (SetProfilePhotoResult , self )._process_custom_annotations (annotation_type , field_path , processor )
262
202
263
- def __repr__ (self ):
264
- return 'SetProfilePhotoResult(profile_photo_url={!r})' .format (
265
- self ._profile_photo_url_value ,
266
- )
267
-
268
203
SetProfilePhotoResult_validator = bv .Struct (SetProfilePhotoResult )
269
204
270
205
PhotoSourceArg ._base64_data_validator = bv .String ()
@@ -276,9 +211,9 @@ def __repr__(self):
276
211
277
212
PhotoSourceArg .other = PhotoSourceArg ('other' )
278
213
279
- SetProfilePhotoArg ._photo_validator = PhotoSourceArg_validator
214
+ SetProfilePhotoArg .photo . validator = PhotoSourceArg_validator
280
215
SetProfilePhotoArg ._all_field_names_ = set (['photo' ])
281
- SetProfilePhotoArg ._all_fields_ = [('photo' , SetProfilePhotoArg ._photo_validator )]
216
+ SetProfilePhotoArg ._all_fields_ = [('photo' , SetProfilePhotoArg .photo . validator )]
282
217
283
218
SetProfilePhotoError ._file_type_error_validator = bv .Void ()
284
219
SetProfilePhotoError ._file_size_error_validator = bv .Void ()
@@ -302,9 +237,9 @@ def __repr__(self):
302
237
SetProfilePhotoError .transient_error = SetProfilePhotoError ('transient_error' )
303
238
SetProfilePhotoError .other = SetProfilePhotoError ('other' )
304
239
305
- SetProfilePhotoResult ._profile_photo_url_validator = bv .String ()
240
+ SetProfilePhotoResult .profile_photo_url . validator = bv .String ()
306
241
SetProfilePhotoResult ._all_field_names_ = set (['profile_photo_url' ])
307
- SetProfilePhotoResult ._all_fields_ = [('profile_photo_url' , SetProfilePhotoResult ._profile_photo_url_validator )]
242
+ SetProfilePhotoResult ._all_fields_ = [('profile_photo_url' , SetProfilePhotoResult .profile_photo_url . validator )]
308
243
309
244
set_profile_photo = bb .Route (
310
245
'set_profile_photo' ,
0 commit comments