Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OrMetadata #21316

Merged
merged 3 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class StorageErrorCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
SEQUENCE_NUMBER_CONDITION_NOT_MET = "SequenceNumberConditionNotMet"
SEQUENCE_NUMBER_INCREMENT_TOO_LARGE = "SequenceNumberIncrementTooLarge"
SNAPSHOT_COUNT_EXCEEDED = "SnapshotCountExceeded"
SNAPHOT_OPERATION_RATE_EXCEEDED = "SnaphotOperationRateExceeded"
SNAPSHOT_OPERATION_RATE_EXCEEDED = "SnapshotOperationRateExceeded"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This typo fix is on me, I did this in the main branch swagger. Is this considered a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not public

SNAPSHOTS_PRESENT = "SnapshotsPresent"
SOURCE_CONDITION_NOT_MET = "SourceConditionNotMet"
SYSTEM_IN_USE = "SystemInUse"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ class BlobItemInternal(msrest.serialization.Model):
:type metadata: ~azure.storage.blob.models.BlobMetadata
:param blob_tags: Blob tags.
:type blob_tags: ~azure.storage.blob.models.BlobTags
:param object_replication_metadata: Dictionary of :code:`<string>`.
:type object_replication_metadata: dict[str, str]
:param has_versions_only:
:type has_versions_only: bool
:param object_replication_metadata: Dictionary of :code:`<string>`.
:type object_replication_metadata: dict[str, str]
"""

_validation = {
Expand All @@ -281,8 +281,8 @@ class BlobItemInternal(msrest.serialization.Model):
'properties': {'key': 'Properties', 'type': 'BlobPropertiesInternal'},
'metadata': {'key': 'Metadata', 'type': 'BlobMetadata'},
'blob_tags': {'key': 'BlobTags', 'type': 'BlobTags'},
'object_replication_metadata': {'key': 'OrMetadata', 'type': '{str}'},
'has_versions_only': {'key': 'HasVersionsOnly', 'type': 'bool'},
'object_replication_metadata': {'key': 'OrMetadata', 'type': '{str}'},
}
_xml_map = {
'name': 'Blob'
Expand All @@ -301,8 +301,8 @@ def __init__(
self.properties = kwargs['properties']
self.metadata = kwargs.get('metadata', None)
self.blob_tags = kwargs.get('blob_tags', None)
self.object_replication_metadata = kwargs.get('object_replication_metadata', None)
self.has_versions_only = kwargs.get('has_versions_only', None)
self.object_replication_metadata = kwargs.get('object_replication_metadata', None)


class BlobMetadata(msrest.serialization.Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ class BlobItemInternal(msrest.serialization.Model):
:type metadata: ~azure.storage.blob.models.BlobMetadata
:param blob_tags: Blob tags.
:type blob_tags: ~azure.storage.blob.models.BlobTags
:param object_replication_metadata: Dictionary of :code:`<string>`.
:type object_replication_metadata: dict[str, str]
:param has_versions_only:
:type has_versions_only: bool
:param object_replication_metadata: Dictionary of :code:`<string>`.
:type object_replication_metadata: dict[str, str]
"""

_validation = {
Expand All @@ -312,8 +312,8 @@ class BlobItemInternal(msrest.serialization.Model):
'properties': {'key': 'Properties', 'type': 'BlobPropertiesInternal'},
'metadata': {'key': 'Metadata', 'type': 'BlobMetadata'},
'blob_tags': {'key': 'BlobTags', 'type': 'BlobTags'},
'object_replication_metadata': {'key': 'OrMetadata', 'type': '{str}'},
'has_versions_only': {'key': 'HasVersionsOnly', 'type': 'bool'},
'object_replication_metadata': {'key': 'OrMetadata', 'type': '{str}'},
}
_xml_map = {
'name': 'Blob'
Expand All @@ -330,8 +330,8 @@ def __init__(
is_current_version: Optional[bool] = None,
metadata: Optional["BlobMetadata"] = None,
blob_tags: Optional["BlobTags"] = None,
object_replication_metadata: Optional[Dict[str, str]] = None,
has_versions_only: Optional[bool] = None,
object_replication_metadata: Optional[Dict[str, str]] = None,
**kwargs
):
super(BlobItemInternal, self).__init__(**kwargs)
Expand All @@ -343,8 +343,8 @@ def __init__(
self.properties = properties
self.metadata = metadata
self.blob_tags = blob_tags
self.object_replication_metadata = object_replication_metadata
self.has_versions_only = has_versions_only
self.object_replication_metadata = object_replication_metadata


class BlobMetadata(msrest.serialization.Model):
Expand Down
2 changes: 0 additions & 2 deletions sdk/storage/azure-storage-blob/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ directive:
- from: swagger-document
where: $.definitions.BlobItemInternal
transform: |
$.discriminator = "OrMetadata";
$.required = [ "OrMetadata" ];
$.properties.OrMetadata = $.properties.ObjectReplicationMetadata;
$.properties.OrMetadata["x-ms-client-name"] = "ObjectReplicationMetadata";
delete $.properties.ObjectReplicationMetadata;
Expand Down