From b5a0274fb477f31e52d6a27e8e24791666c6e11c Mon Sep 17 00:00:00 2001 From: Mohit Sharma <65536214+mohsha-msft@users.noreply.github.com> Date: Sat, 27 Mar 2021 12:10:08 +0530 Subject: [PATCH 1/3] Updated Service Version to 2020-04-08 --- azfile/url_share.go | 4 +- azfile/zz_generated_client.go | 2 +- azfile/zz_generated_models.go | 128 +++++++++++++++++++++------------ azfile/zz_generated_share.go | 31 +++++--- azfile/zz_generated_version.go | 2 +- swagger/README.md | 2 +- 6 files changed, 108 insertions(+), 61 deletions(-) diff --git a/azfile/url_share.go b/azfile/url_share.go index b7d5cea..2c7a6de 100644 --- a/azfile/url_share.go +++ b/azfile/url_share.go @@ -71,7 +71,7 @@ func (s ShareURL) Create(ctx context.Context, metadata Metadata, quotaInGB int32 if quotaInGB != 0 { quota = "aInGB } - return s.shareClient.Create(ctx, nil, metadata, quota, ShareAccessTierNone) + return s.shareClient.Create(ctx, nil, metadata, quota, ShareAccessTierNone, nil, ShareRootSquashNone) } // CreateSnapshot creates a read-only snapshot of a share. @@ -101,7 +101,7 @@ func (s ShareURL) SetProperties(ctx context.Context, quotaInGB int32) (*ShareSet if quotaInGB != 0 { quota = "aInGB } - return s.shareClient.SetProperties(ctx, nil, quota, ShareAccessTierNone, nil) + return s.shareClient.SetProperties(ctx, nil, quota, ShareAccessTierNone, nil, ShareRootSquashNone) } // SetMetadata sets the share's metadata. diff --git a/azfile/zz_generated_client.go b/azfile/zz_generated_client.go index d7383ee..5bdb414 100644 --- a/azfile/zz_generated_client.go +++ b/azfile/zz_generated_client.go @@ -10,7 +10,7 @@ import ( const ( // ServiceVersion specifies the version of the operations used in this package. - ServiceVersion = "2020-02-10" + ServiceVersion = "2020-04-08" ) // managementClient is the base client for Azfile. diff --git a/azfile/zz_generated_models.go b/azfile/zz_generated_models.go index 976e512..6f883b9 100644 --- a/azfile/zz_generated_models.go +++ b/azfile/zz_generated_models.go @@ -260,6 +260,25 @@ func PossibleShareAccessTierTypeValues() []ShareAccessTierType { return []ShareAccessTierType{ShareAccessTierCool, ShareAccessTierHot, ShareAccessTierNone, ShareAccessTierTransactionOptimized} } +// ShareRootSquashType enumerates the values for share root squash type. +type ShareRootSquashType string + +const ( + // ShareRootSquashAllSquash ... + ShareRootSquashAllSquash ShareRootSquashType = "AllSquash" + // ShareRootSquashNone represents an empty ShareRootSquashType. + ShareRootSquashNone ShareRootSquashType = "" + // ShareRootSquashNoRootSquash ... + ShareRootSquashNoRootSquash ShareRootSquashType = "NoRootSquash" + // ShareRootSquashRootSquash ... + ShareRootSquashRootSquash ShareRootSquashType = "RootSquash" +) + +// PossibleShareRootSquashTypeValues returns an array of possible values for the ShareRootSquashType const type. +func PossibleShareRootSquashTypeValues() []ShareRootSquashType { + return []ShareRootSquashType{ShareRootSquashAllSquash, ShareRootSquashNone, ShareRootSquashNoRootSquash, ShareRootSquashRootSquash} +} + // StorageErrorCodeType enumerates the values for storage error code type. type StorageErrorCodeType string @@ -2631,13 +2650,13 @@ func (lhr ListHandlesResponse) Version() string { type ListSharesResponse struct { rawResponse *http.Response // XMLName is used for marshalling and is subject to removal in a future release. - XMLName xml.Name `xml:"EnumerationResults"` - ServiceEndpoint string `xml:"ServiceEndpoint,attr"` - Prefix *string `xml:"Prefix"` - Marker *string `xml:"Marker"` - MaxResults *int32 `xml:"MaxResults"` - ShareItems []ShareItem `xml:"Shares>Share"` - NextMarker Marker `xml:"NextMarker"` + XMLName xml.Name `xml:"EnumerationResults"` + ServiceEndpoint string `xml:"ServiceEndpoint,attr"` + Prefix *string `xml:"Prefix"` + Marker *string `xml:"Marker"` + MaxResults *int32 `xml:"MaxResults"` + ShareItems []ShareItemInternal `xml:"Shares>Share"` + NextMarker Marker `xml:"NextMarker"` } // Response returns the raw HTTP response object. @@ -3353,6 +3372,11 @@ func (sgpr ShareGetPropertiesResponse) Date() time.Time { return t } +// EnabledProtocols returns the value for header x-ms-enabled-protocols. +func (sgpr ShareGetPropertiesResponse) EnabledProtocols() string { + return sgpr.rawResponse.Header.Get("x-ms-enabled-protocols") +} + // ErrorCode returns the value for header x-ms-error-code. func (sgpr ShareGetPropertiesResponse) ErrorCode() string { return sgpr.rawResponse.Header.Get("x-ms-error-code") @@ -3461,21 +3485,26 @@ func (sgpr ShareGetPropertiesResponse) RequestID() string { return sgpr.rawResponse.Header.Get("x-ms-request-id") } +// RootSquash returns the value for header x-ms-root-squash. +func (sgpr ShareGetPropertiesResponse) RootSquash() ShareRootSquashType { + return ShareRootSquashType(sgpr.rawResponse.Header.Get("x-ms-root-squash")) +} + // Version returns the value for header x-ms-version. func (sgpr ShareGetPropertiesResponse) Version() string { return sgpr.rawResponse.Header.Get("x-ms-version") } -// ShareItem - A listed Azure Storage share item. -type ShareItem struct { +// ShareItemInternal - A listed Azure Storage share item. +type ShareItemInternal struct { // XMLName is used for marshalling and is subject to removal in a future release. - XMLName xml.Name `xml:"Share"` - Name string `xml:"Name"` - Snapshot *string `xml:"Snapshot"` - Deleted *bool `xml:"Deleted"` - Version *string `xml:"Version"` - Properties ShareProperties `xml:"Properties"` - Metadata Metadata `xml:"Metadata"` + XMLName xml.Name `xml:"Share"` + Name string `xml:"Name"` + Snapshot *string `xml:"Snapshot"` + Deleted *bool `xml:"Deleted"` + Version *string `xml:"Version"` + Properties SharePropertiesInternal `xml:"Properties"` + Metadata Metadata `xml:"Metadata"` } // SharePermission - A permission (a security descriptor) at the share level. @@ -3528,8 +3557,8 @@ func (sp SharePermission) Version() string { return sp.rawResponse.Header.Get("x-ms-version") } -// ShareProperties - Properties of a share. -type ShareProperties struct { +// SharePropertiesInternal - Properties of a share. +type SharePropertiesInternal struct { LastModified time.Time `xml:"Last-Modified"` Etag ETag `xml:"Etag"` Quota int32 `xml:"Quota"` @@ -3547,23 +3576,28 @@ type ShareProperties struct { // LeaseState - Possible values include: 'LeaseStateAvailable', 'LeaseStateLeased', 'LeaseStateExpired', 'LeaseStateBreaking', 'LeaseStateBroken', 'LeaseStateNone' LeaseState LeaseStateType `xml:"LeaseState"` // LeaseDuration - Possible values include: 'LeaseDurationInfinite', 'LeaseDurationFixed', 'LeaseDurationNone' - LeaseDuration LeaseDurationType `xml:"LeaseDuration"` + LeaseDuration LeaseDurationType `xml:"LeaseDuration"` + EnabledProtocols *string `xml:"EnabledProtocols"` + // RootSquash - Possible values include: 'ShareRootSquashNoRootSquash', 'ShareRootSquashRootSquash', 'ShareRootSquashAllSquash', 'ShareRootSquashNone' + RootSquash ShareRootSquashType `xml:"RootSquash"` } -// MarshalXML implements the xml.Marshaler interface for ShareProperties. -func (sp ShareProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - sp2 := (*shareProperties)(unsafe.Pointer(&sp)) - return e.EncodeElement(*sp2, start) +// MarshalXML implements the xml.Marshaler interface for SharePropertiesInternal. +func (spi SharePropertiesInternal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + spi2 := (*sharePropertiesInternal)(unsafe.Pointer(&spi)) + return e.EncodeElement(*spi2, start) } -// UnmarshalXML implements the xml.Unmarshaler interface for ShareProperties. -func (sp *ShareProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - sp2 := (*shareProperties)(unsafe.Pointer(sp)) - return d.DecodeElement(sp2, &start) +// UnmarshalXML implements the xml.Unmarshaler interface for SharePropertiesInternal. +func (spi *SharePropertiesInternal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + spi2 := (*sharePropertiesInternal)(unsafe.Pointer(spi)) + return d.DecodeElement(spi2, &start) } // ShareProtocolSettings - Protocol settings type ShareProtocolSettings struct { + // XMLName is used for marshalling and is subject to removal in a future release. + XMLName xml.Name `xml:"ProtocolSettings"` // Smb - Settings for SMB protocol. Smb *ShareSmbSettings `xml:"SMB"` } @@ -3986,6 +4020,8 @@ func (sspr ShareSetPropertiesResponse) Version() string { // ShareSmbSettings - Settings for SMB protocol. type ShareSmbSettings struct { + // XMLName is used for marshalling and is subject to removal in a future release. + XMLName xml.Name `xml:"SMB"` // Multichannel - Settings for SMB Multichannel. Multichannel *SmbMultichannel `xml:"Multichannel"` } @@ -4196,8 +4232,8 @@ func init() { if reflect.TypeOf((*HandleItem)(nil)).Elem().Size() != reflect.TypeOf((*handleItem)(nil)).Elem().Size() { validateError(errors.New("size mismatch between HandleItem and handleItem")) } - if reflect.TypeOf((*ShareProperties)(nil)).Elem().Size() != reflect.TypeOf((*shareProperties)(nil)).Elem().Size() { - validateError(errors.New("size mismatch between ShareProperties and shareProperties")) + if reflect.TypeOf((*SharePropertiesInternal)(nil)).Elem().Size() != reflect.TypeOf((*sharePropertiesInternal)(nil)).Elem().Size() { + validateError(errors.New("size mismatch between SharePropertiesInternal and sharePropertiesInternal")) } } @@ -4262,20 +4298,22 @@ type handleItem struct { } // internal type used for marshalling -type shareProperties struct { - LastModified timeRFC1123 `xml:"Last-Modified"` - Etag ETag `xml:"Etag"` - Quota int32 `xml:"Quota"` - ProvisionedIops *int32 `xml:"ProvisionedIops"` - ProvisionedIngressMBps *int32 `xml:"ProvisionedIngressMBps"` - ProvisionedEgressMBps *int32 `xml:"ProvisionedEgressMBps"` - NextAllowedQuotaDowngradeTime *timeRFC1123 `xml:"NextAllowedQuotaDowngradeTime"` - DeletedTime *timeRFC1123 `xml:"DeletedTime"` - RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"` - AccessTier *string `xml:"AccessTier"` - AccessTierChangeTime *timeRFC1123 `xml:"AccessTierChangeTime"` - AccessTierTransitionState *string `xml:"AccessTierTransitionState"` - LeaseStatus LeaseStatusType `xml:"LeaseStatus"` - LeaseState LeaseStateType `xml:"LeaseState"` - LeaseDuration LeaseDurationType `xml:"LeaseDuration"` +type sharePropertiesInternal struct { + LastModified timeRFC1123 `xml:"Last-Modified"` + Etag ETag `xml:"Etag"` + Quota int32 `xml:"Quota"` + ProvisionedIops *int32 `xml:"ProvisionedIops"` + ProvisionedIngressMBps *int32 `xml:"ProvisionedIngressMBps"` + ProvisionedEgressMBps *int32 `xml:"ProvisionedEgressMBps"` + NextAllowedQuotaDowngradeTime *timeRFC1123 `xml:"NextAllowedQuotaDowngradeTime"` + DeletedTime *timeRFC1123 `xml:"DeletedTime"` + RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"` + AccessTier *string `xml:"AccessTier"` + AccessTierChangeTime *timeRFC1123 `xml:"AccessTierChangeTime"` + AccessTierTransitionState *string `xml:"AccessTierTransitionState"` + LeaseStatus LeaseStatusType `xml:"LeaseStatus"` + LeaseState LeaseStateType `xml:"LeaseState"` + LeaseDuration LeaseDurationType `xml:"LeaseDuration"` + EnabledProtocols *string `xml:"EnabledProtocols"` + RootSquash ShareRootSquashType `xml:"RootSquash"` } diff --git a/azfile/zz_generated_share.go b/azfile/zz_generated_share.go index 1072a24..e06e19c 100644 --- a/azfile/zz_generated_share.go +++ b/azfile/zz_generated_share.go @@ -6,7 +6,6 @@ package azfile import ( "bytes" "context" - "encoding/json" "encoding/xml" "github.com/Azure/azure-pipeline-go/pipeline" "io" @@ -245,8 +244,9 @@ func (client shareClient) changeLeaseResponder(resp pipeline.Response) (pipeline // href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting // Timeouts for File Service Operations. metadata is a name-value pair to associate with a file storage object. // quota is specifies the maximum size of the share, in gigabytes. accessTier is specifies the access tier of the -// share. -func (client shareClient) Create(ctx context.Context, timeout *int32, metadata map[string]string, quota *int32, accessTier ShareAccessTierType) (*ShareCreateResponse, error) { +// share. enabledProtocols is protocols to enable on the share. rootSquash is root squash to set on the share. Only +// valid for NFS shares. +func (client shareClient) Create(ctx context.Context, timeout *int32, metadata map[string]string, quota *int32, accessTier ShareAccessTierType, enabledProtocols *string, rootSquash ShareRootSquashType) (*ShareCreateResponse, error) { if err := validate([]validation{ {targetValue: timeout, constraints: []constraint{{target: "timeout", name: null, rule: false, @@ -256,7 +256,7 @@ func (client shareClient) Create(ctx context.Context, timeout *int32, metadata m chain: []constraint{{target: "quota", name: inclusiveMinimum, rule: 1, chain: nil}}}}}}); err != nil { return nil, err } - req, err := client.createPreparer(timeout, metadata, quota, accessTier) + req, err := client.createPreparer(timeout, metadata, quota, accessTier, enabledProtocols, rootSquash) if err != nil { return nil, err } @@ -268,7 +268,7 @@ func (client shareClient) Create(ctx context.Context, timeout *int32, metadata m } // createPreparer prepares the Create request. -func (client shareClient) createPreparer(timeout *int32, metadata map[string]string, quota *int32, accessTier ShareAccessTierType) (pipeline.Request, error) { +func (client shareClient) createPreparer(timeout *int32, metadata map[string]string, quota *int32, accessTier ShareAccessTierType, enabledProtocols *string, rootSquash ShareRootSquashType) (pipeline.Request, error) { req, err := pipeline.NewRequest("PUT", client.url, nil) if err != nil { return req, pipeline.NewError(err, "failed to create request") @@ -291,6 +291,12 @@ func (client shareClient) createPreparer(timeout *int32, metadata map[string]str req.Header.Set("x-ms-access-tier", string(accessTier)) } req.Header.Set("x-ms-version", ServiceVersion) + if enabledProtocols != nil { + req.Header.Set("x-ms-enabled-protocols", *enabledProtocols) + } + if rootSquash != ShareRootSquashNone { + req.Header.Set("x-ms-root-squash", string(rootSquash)) + } return req, nil } @@ -343,7 +349,7 @@ func (client shareClient) createPermissionPreparer(sharePermission SharePermissi params.Set("comp", "filepermission") req.URL.RawQuery = params.Encode() req.Header.Set("x-ms-version", ServiceVersion) - b, err := json.Marshal(sharePermission) + b, err := xml.Marshal(sharePermission) if err != nil { return req, pipeline.NewError(err, "failed to marshal request body") } @@ -613,7 +619,7 @@ func (client shareClient) getPermissionResponder(resp pipeline.Response) (pipeli } if len(b) > 0 { b = removeBOM(b) - err = json.Unmarshal(b, result) + err = xml.Unmarshal(b, result) if err != nil { return result, NewResponseError(err, resp.Response(), "failed to unmarshal response body") } @@ -1069,8 +1075,8 @@ func (client shareClient) setMetadataResponder(resp pipeline.Response) (pipeline // href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting // Timeouts for File Service Operations. quota is specifies the maximum size of the share, in gigabytes. accessTier // is specifies the access tier of the share. leaseID is if specified, the operation only succeeds if the resource's -// lease is active and matches this ID. -func (client shareClient) SetProperties(ctx context.Context, timeout *int32, quota *int32, accessTier ShareAccessTierType, leaseID *string) (*ShareSetPropertiesResponse, error) { +// lease is active and matches this ID. rootSquash is root squash to set on the share. Only valid for NFS shares. +func (client shareClient) SetProperties(ctx context.Context, timeout *int32, quota *int32, accessTier ShareAccessTierType, leaseID *string, rootSquash ShareRootSquashType) (*ShareSetPropertiesResponse, error) { if err := validate([]validation{ {targetValue: timeout, constraints: []constraint{{target: "timeout", name: null, rule: false, @@ -1080,7 +1086,7 @@ func (client shareClient) SetProperties(ctx context.Context, timeout *int32, quo chain: []constraint{{target: "quota", name: inclusiveMinimum, rule: 1, chain: nil}}}}}}); err != nil { return nil, err } - req, err := client.setPropertiesPreparer(timeout, quota, accessTier, leaseID) + req, err := client.setPropertiesPreparer(timeout, quota, accessTier, leaseID, rootSquash) if err != nil { return nil, err } @@ -1092,7 +1098,7 @@ func (client shareClient) SetProperties(ctx context.Context, timeout *int32, quo } // setPropertiesPreparer prepares the SetProperties request. -func (client shareClient) setPropertiesPreparer(timeout *int32, quota *int32, accessTier ShareAccessTierType, leaseID *string) (pipeline.Request, error) { +func (client shareClient) setPropertiesPreparer(timeout *int32, quota *int32, accessTier ShareAccessTierType, leaseID *string, rootSquash ShareRootSquashType) (pipeline.Request, error) { req, err := pipeline.NewRequest("PUT", client.url, nil) if err != nil { return req, pipeline.NewError(err, "failed to create request") @@ -1114,6 +1120,9 @@ func (client shareClient) setPropertiesPreparer(timeout *int32, quota *int32, ac if leaseID != nil { req.Header.Set("x-ms-lease-id", *leaseID) } + if rootSquash != ShareRootSquashNone { + req.Header.Set("x-ms-root-squash", string(rootSquash)) + } return req, nil } diff --git a/azfile/zz_generated_version.go b/azfile/zz_generated_version.go index 8a61a2f..10b242b 100644 --- a/azfile/zz_generated_version.go +++ b/azfile/zz_generated_version.go @@ -5,7 +5,7 @@ package azfile // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/0.0.0 azfile/2020-02-10" + return "Azure-SDK-For-Go/0.0.0 azfile/2020-04-08" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/swagger/README.md b/swagger/README.md index c33d6a8..b533d45 100644 --- a/swagger/README.md +++ b/swagger/README.md @@ -15,7 +15,7 @@ More modifications have to be made after generation in order to fix issues that ### Settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.FileStorage/preview/2020-02-10/file.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.FileStorage/preview/2020-04-08/file.json go: true output-folder: Go_FileStorage namespace: azfile From cde5cbb5cd13171b82cbf384fb4d31ad406e383d Mon Sep 17 00:00:00 2001 From: Mohit Sharma <65536214+mohsha-msft@users.noreply.github.com> Date: Sat, 27 Mar 2021 12:20:58 +0530 Subject: [PATCH 2/3] Minor Test Fix --- azfile/zz_generated_share.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azfile/zz_generated_share.go b/azfile/zz_generated_share.go index e06e19c..f40291b 100644 --- a/azfile/zz_generated_share.go +++ b/azfile/zz_generated_share.go @@ -6,6 +6,7 @@ package azfile import ( "bytes" "context" + "encoding/json" "encoding/xml" "github.com/Azure/azure-pipeline-go/pipeline" "io" @@ -349,7 +350,7 @@ func (client shareClient) createPermissionPreparer(sharePermission SharePermissi params.Set("comp", "filepermission") req.URL.RawQuery = params.Encode() req.Header.Set("x-ms-version", ServiceVersion) - b, err := xml.Marshal(sharePermission) + b, err := json.Marshal(sharePermission) if err != nil { return req, pipeline.NewError(err, "failed to marshal request body") } @@ -619,7 +620,7 @@ func (client shareClient) getPermissionResponder(resp pipeline.Response) (pipeli } if len(b) > 0 { b = removeBOM(b) - err = xml.Unmarshal(b, result) + err = json.Unmarshal(b, result) if err != nil { return result, NewResponseError(err, resp.Response(), "failed to unmarshal response body") } From 5160a09d9f3481df449462eaeab89f80798e01ee Mon Sep 17 00:00:00 2001 From: Mohit Sharma <65536214+mohsha-msft@users.noreply.github.com> Date: Sat, 27 Mar 2021 12:28:50 +0530 Subject: [PATCH 3/3] Fixed name conflicts --- azfile/zz_generated_models.go | 54 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/azfile/zz_generated_models.go b/azfile/zz_generated_models.go index 6f883b9..32a0386 100644 --- a/azfile/zz_generated_models.go +++ b/azfile/zz_generated_models.go @@ -2650,13 +2650,13 @@ func (lhr ListHandlesResponse) Version() string { type ListSharesResponse struct { rawResponse *http.Response // XMLName is used for marshalling and is subject to removal in a future release. - XMLName xml.Name `xml:"EnumerationResults"` - ServiceEndpoint string `xml:"ServiceEndpoint,attr"` - Prefix *string `xml:"Prefix"` - Marker *string `xml:"Marker"` - MaxResults *int32 `xml:"MaxResults"` - ShareItems []ShareItemInternal `xml:"Shares>Share"` - NextMarker Marker `xml:"NextMarker"` + XMLName xml.Name `xml:"EnumerationResults"` + ServiceEndpoint string `xml:"ServiceEndpoint,attr"` + Prefix *string `xml:"Prefix"` + Marker *string `xml:"Marker"` + MaxResults *int32 `xml:"MaxResults"` + ShareItems []ShareItem `xml:"Shares>Share"` + NextMarker Marker `xml:"NextMarker"` } // Response returns the raw HTTP response object. @@ -3495,16 +3495,16 @@ func (sgpr ShareGetPropertiesResponse) Version() string { return sgpr.rawResponse.Header.Get("x-ms-version") } -// ShareItemInternal - A listed Azure Storage share item. -type ShareItemInternal struct { +// ShareItem - A listed Azure Storage share item. +type ShareItem struct { // XMLName is used for marshalling and is subject to removal in a future release. - XMLName xml.Name `xml:"Share"` - Name string `xml:"Name"` - Snapshot *string `xml:"Snapshot"` - Deleted *bool `xml:"Deleted"` - Version *string `xml:"Version"` - Properties SharePropertiesInternal `xml:"Properties"` - Metadata Metadata `xml:"Metadata"` + XMLName xml.Name `xml:"Share"` + Name string `xml:"Name"` + Snapshot *string `xml:"Snapshot"` + Deleted *bool `xml:"Deleted"` + Version *string `xml:"Version"` + Properties ShareProperties `xml:"Properties"` + Metadata Metadata `xml:"Metadata"` } // SharePermission - A permission (a security descriptor) at the share level. @@ -3557,8 +3557,8 @@ func (sp SharePermission) Version() string { return sp.rawResponse.Header.Get("x-ms-version") } -// SharePropertiesInternal - Properties of a share. -type SharePropertiesInternal struct { +// ShareProperties - Properties of a share. +type ShareProperties struct { LastModified time.Time `xml:"Last-Modified"` Etag ETag `xml:"Etag"` Quota int32 `xml:"Quota"` @@ -3582,16 +3582,16 @@ type SharePropertiesInternal struct { RootSquash ShareRootSquashType `xml:"RootSquash"` } -// MarshalXML implements the xml.Marshaler interface for SharePropertiesInternal. -func (spi SharePropertiesInternal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - spi2 := (*sharePropertiesInternal)(unsafe.Pointer(&spi)) +// MarshalXML implements the xml.Marshaler interface for ShareProperties. +func (sp ShareProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + spi2 := (*sharePropertiesInternal)(unsafe.Pointer(&sp)) return e.EncodeElement(*spi2, start) } -// UnmarshalXML implements the xml.Unmarshaler interface for SharePropertiesInternal. -func (spi *SharePropertiesInternal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - spi2 := (*sharePropertiesInternal)(unsafe.Pointer(spi)) - return d.DecodeElement(spi2, &start) +// UnmarshalXML implements the xml.Unmarshaler interface for ShareProperties. +func (sp *ShareProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + sp2 := (*sharePropertiesInternal)(unsafe.Pointer(sp)) + return d.DecodeElement(sp2, &start) } // ShareProtocolSettings - Protocol settings @@ -4232,8 +4232,8 @@ func init() { if reflect.TypeOf((*HandleItem)(nil)).Elem().Size() != reflect.TypeOf((*handleItem)(nil)).Elem().Size() { validateError(errors.New("size mismatch between HandleItem and handleItem")) } - if reflect.TypeOf((*SharePropertiesInternal)(nil)).Elem().Size() != reflect.TypeOf((*sharePropertiesInternal)(nil)).Elem().Size() { - validateError(errors.New("size mismatch between SharePropertiesInternal and sharePropertiesInternal")) + if reflect.TypeOf((*ShareProperties)(nil)).Elem().Size() != reflect.TypeOf((*sharePropertiesInternal)(nil)).Elem().Size() { + validateError(errors.New("size mismatch between ShareProperties and sharePropertiesInternal")) } }