@@ -92,18 +92,15 @@ def __init__(self, client_token=None, description=None, instance_id=None, kind=N
9292 self .kind = kind
9393 if project_name is not None :
9494 self .project_name = project_name
95- if size is not None :
96- self .size = size
95+ self .size = size
9796 if snapshot_id is not None :
9897 self .snapshot_id = snapshot_id
9998 if tags is not None :
10099 self .tags = tags
101100 if volume_charge_type is not None :
102101 self .volume_charge_type = volume_charge_type
103- if volume_name is not None :
104- self .volume_name = volume_name
105- if volume_type is not None :
106- self .volume_type = volume_type
102+ self .volume_name = volume_name
103+ self .volume_type = volume_type
107104 if zone_id is not None :
108105 self .zone_id = zone_id
109106
@@ -230,6 +227,8 @@ def size(self, size):
230227 :param size: The size of this CreateVolumeRequest. # noqa: E501
231228 :type: str
232229 """
230+ if self ._configuration .client_side_validation and size is None :
231+ raise ValueError ("Invalid value for `size`, must not be `None`" ) # noqa: E501
233232
234233 self ._size = size
235234
@@ -314,6 +313,8 @@ def volume_name(self, volume_name):
314313 :param volume_name: The volume_name of this CreateVolumeRequest. # noqa: E501
315314 :type: str
316315 """
316+ if self ._configuration .client_side_validation and volume_name is None :
317+ raise ValueError ("Invalid value for `volume_name`, must not be `None`" ) # noqa: E501
317318
318319 self ._volume_name = volume_name
319320
@@ -335,6 +336,8 @@ def volume_type(self, volume_type):
335336 :param volume_type: The volume_type of this CreateVolumeRequest. # noqa: E501
336337 :type: str
337338 """
339+ if self ._configuration .client_side_validation and volume_type is None :
340+ raise ValueError ("Invalid value for `volume_type`, must not be `None`" ) # noqa: E501
338341
339342 self ._volume_type = volume_type
340343
0 commit comments