-
Notifications
You must be signed in to change notification settings - Fork 61
if constant is optional, don't force to value #952
Changes from 2 commits
fe7381d
47ba074
bf29f73
5cc15dc
9ff9973
45b4dc0
9a269c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,47 +164,33 @@ def __init__(self, **kwargs): | |
| class NoModelAsStringNoRequiredOneValueDefault(msrest.serialization.Model): | ||
| """NoModelAsStringNoRequiredOneValueDefault. | ||
|
|
||
| Variables are only populated by the server, and will be ignored when sending a request. | ||
|
|
||
| :ivar parameter: Default value: "value1". | ||
| :vartype parameter: str | ||
| :param parameter: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| :type parameter: str | ||
| """ | ||
|
|
||
| _validation = { | ||
| "parameter": {"constant": True}, | ||
| } | ||
|
|
||
| _attribute_map = { | ||
| "parameter": {"key": "parameter", "type": "str"}, | ||
| } | ||
|
|
||
| parameter = "value1" | ||
|
|
||
| def __init__(self, **kwargs): | ||
| super(NoModelAsStringNoRequiredOneValueDefault, self).__init__(**kwargs) | ||
| self.parameter = kwargs.get("parameter", "value1") | ||
|
|
||
|
|
||
| class NoModelAsStringNoRequiredOneValueNoDefault(msrest.serialization.Model): | ||
| """NoModelAsStringNoRequiredOneValueNoDefault. | ||
|
|
||
| Variables are only populated by the server, and will be ignored when sending a request. | ||
|
|
||
| :ivar parameter: Default value: "value1". | ||
| :vartype parameter: str | ||
| :param parameter: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. swagger. This is an optional constant with no default, so we default to The doc should also be improved here, so we show the one non-
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add docstring fix to this PR |
||
| :type parameter: str | ||
| """ | ||
|
|
||
| _validation = { | ||
| "parameter": {"constant": True}, | ||
| } | ||
|
|
||
| _attribute_map = { | ||
| "parameter": {"key": "parameter", "type": "str"}, | ||
| } | ||
|
|
||
| parameter = "value1" | ||
|
|
||
| def __init__(self, **kwargs): | ||
| super(NoModelAsStringNoRequiredOneValueNoDefault, self).__init__(**kwargs) | ||
| self.parameter = kwargs.get("parameter", None) | ||
|
|
||
|
|
||
| class NoModelAsStringNoRequiredTwoValueDefault(msrest.serialization.Model): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,8 +159,6 @@ def __init__(self, **kwargs): | |
| class FlattenParameterGroup(msrest.serialization.Model): | ||
| """Parameter group. | ||
|
|
||
| Variables are only populated by the server, and will be ignored when sending a request. | ||
|
|
||
| All required parameters must be populated in order to send to Azure. | ||
|
|
||
| :param name: Required. Product name with value 'groupproduct'. | ||
|
|
@@ -175,8 +173,8 @@ class FlattenParameterGroup(msrest.serialization.Model): | |
| :type description: str | ||
| :param max_product_display_name: Display name of product. | ||
| :type max_product_display_name: str | ||
| :ivar capacity: Capacity of product. For example, 4 people. Default value: "Large". | ||
| :vartype capacity: str | ||
| :param capacity: Capacity of product. For example, 4 people. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. swagger. Since current behavior of enum is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ask tim about whether |
||
| :type capacity: str | ||
| :param generic_value: Generic URL value. | ||
| :type generic_value: str | ||
| :param odata_value: URL value. | ||
|
|
@@ -186,7 +184,6 @@ class FlattenParameterGroup(msrest.serialization.Model): | |
| _validation = { | ||
| "name": {"required": True}, | ||
| "product_id": {"required": True}, | ||
| "capacity": {"constant": True}, | ||
| } | ||
|
|
||
| _attribute_map = { | ||
|
|
@@ -200,15 +197,14 @@ class FlattenParameterGroup(msrest.serialization.Model): | |
| "odata_value": {"key": "@odata\\.value", "type": "str"}, | ||
| } | ||
|
|
||
| capacity = "Large" | ||
|
|
||
| def __init__(self, **kwargs): | ||
| super(FlattenParameterGroup, self).__init__(**kwargs) | ||
| self.name = kwargs["name"] | ||
| self.simple_body_product = kwargs.get("simple_body_product", None) | ||
| self.product_id = kwargs["product_id"] | ||
| self.description = kwargs.get("description", None) | ||
| self.max_product_display_name = kwargs.get("max_product_display_name", None) | ||
| self.capacity = kwargs.get("capacity", None) | ||
| self.generic_value = kwargs.get("generic_value", None) | ||
| self.odata_value = kwargs.get("odata_value", None) | ||
|
|
||
|
|
@@ -291,8 +287,6 @@ def __init__(self, **kwargs): | |
| class SimpleProduct(BaseProduct): | ||
| """The product documentation. | ||
|
|
||
| Variables are only populated by the server, and will be ignored when sending a request. | ||
|
|
||
| All required parameters must be populated in order to send to Azure. | ||
|
|
||
| :param product_id: Required. Unique identifier representing a specific product for a given | ||
|
|
@@ -303,8 +297,8 @@ class SimpleProduct(BaseProduct): | |
| :type description: str | ||
| :param max_product_display_name: Display name of product. | ||
| :type max_product_display_name: str | ||
| :ivar capacity: Capacity of product. For example, 4 people. Default value: "Large". | ||
| :vartype capacity: str | ||
| :param capacity: Capacity of product. For example, 4 people. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same param as above |
||
| :type capacity: str | ||
| :param generic_value: Generic URL value. | ||
| :type generic_value: str | ||
| :param odata_value: URL value. | ||
|
|
@@ -313,7 +307,6 @@ class SimpleProduct(BaseProduct): | |
|
|
||
| _validation = { | ||
| "product_id": {"required": True}, | ||
| "capacity": {"constant": True}, | ||
| } | ||
|
|
||
| _attribute_map = { | ||
|
|
@@ -325,11 +318,10 @@ class SimpleProduct(BaseProduct): | |
| "odata_value": {"key": "details.max_product_image.@odata\\.value", "type": "str"}, | ||
| } | ||
|
|
||
| capacity = "Large" | ||
|
|
||
| def __init__(self, **kwargs): | ||
| super(SimpleProduct, self).__init__(**kwargs) | ||
| self.max_product_display_name = kwargs.get("max_product_display_name", None) | ||
| self.capacity = kwargs.get("capacity", None) | ||
| self.generic_value = kwargs.get("generic_value", None) | ||
| self.odata_value = kwargs.get("odata_value", None) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decided to make
constantandvalidation_mapreadonly properties to unclutter the main__init__and because we don't set them later