Update service version to 2020-08-04 and add markdown directives (#288)

This commit is contained in:
adreed-msft 2021-07-13 12:05:45 -07:00 коммит произвёл GitHub
Родитель c166691385
Коммит 66275612aa
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
15 изменённых файлов: 1233 добавлений и 12666 удалений

Просмотреть файл

@ -68,6 +68,8 @@ func (ab AppendBlobURL) Create(ctx context.Context, h BlobHTTPHeaders, metadata
nil, // Blob ifTags
nil,
blobTagsString, // Blob tags
// immutability policy
nil, BlobImmutabilityPolicyModeNone, nil,
)
}

Просмотреть файл

@ -2,9 +2,10 @@ package azblob
import (
"context"
"github.com/Azure/azure-pipeline-go/pipeline"
"net/url"
"strings"
"github.com/Azure/azure-pipeline-go/pipeline"
)
// A BlobURL represents a URL to an Azure Storage blob; the blob may be a block blob, append blob, or page blob.
@ -310,7 +311,10 @@ func (b BlobURL) StartCopyFromURL(ctx context.Context, source url.URL, metadata
dstLeaseID,
nil,
blobTagsString, // Blob tags
nil)
nil,
// immutability policy
nil, BlobImmutabilityPolicyModeNone, nil,
)
}
// AbortCopyFromURL stops a pending copy that was previously started and leaves a destination blob with 0 length and metadata.

Просмотреть файл

@ -80,6 +80,8 @@ func (bb BlockBlobURL) Upload(ctx context.Context, body io.ReadSeeker, h BlobHTT
nil, // Blob ifTags
nil,
blobTagsString, // Blob tags
// immutability policy
nil, BlobImmutabilityPolicyModeNone, nil,
)
}
@ -127,6 +129,8 @@ func (bb BlockBlobURL) CommitBlockList(ctx context.Context, base64BlockIDs []str
nil, // Blob ifTags
nil,
blobTagsString, // Blob tags
// immutability policy
nil, BlobImmutabilityPolicyModeNone, nil,
)
}
@ -154,6 +158,8 @@ func (bb BlockBlobURL) CopyFromURL(ctx context.Context, source url.URL, metadata
nil, // Blob ifTags
dstLeaseID, nil, srcContentMD5,
blobTagsString, // Blob tags
// immutability policy
nil, BlobImmutabilityPolicyModeNone, nil,
)
}

Просмотреть файл

@ -70,6 +70,8 @@ func (pb PageBlobURL) Create(ctx context.Context, size int64, sequenceNumber int
nil, // Blob tags
&sequenceNumber, nil,
blobTagsString, // Blob tags
// immutability policy
nil, BlobImmutabilityPolicyModeNone, nil,
)
}

Просмотреть файл

@ -329,15 +329,17 @@ func (client appendBlobClient) appendBlockFromURLResponder(resp pipeline.Respons
// specify an ETag value to operate only on blobs without a matching value. ifTags is specify a SQL where clause on
// blob tags to operate only on blobs with a matching value. requestID is provides a client-generated, opaque value
// with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
// blobTagsString is optional. Used to set blob tags in various blob operations.
func (client appendBlobClient) Create(ctx context.Context, contentLength int64, timeout *int32, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string) (*AppendBlobCreateResponse, error) {
// blobTagsString is optional. Used to set blob tags in various blob operations. immutabilityPolicyExpiry is specifies
// the date time when the blobs immutability policy is set to expire. immutabilityPolicyMode is specifies the
// immutability policy mode to set on the blob. legalHold is specified if a legal hold should be set on the blob.
func (client appendBlobClient) Create(ctx context.Context, contentLength int64, timeout *int32, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (*AppendBlobCreateResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.createPreparer(contentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID, blobTagsString)
req, err := client.createPreparer(contentLength, timeout, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold)
if err != nil {
return nil, err
}
@ -349,7 +351,7 @@ func (client appendBlobClient) Create(ctx context.Context, contentLength int64,
}
// createPreparer prepares the Create request.
func (client appendBlobClient) createPreparer(contentLength int64, timeout *int32, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string) (pipeline.Request, error) {
func (client appendBlobClient) createPreparer(contentLength int64, timeout *int32, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -420,6 +422,15 @@ func (client appendBlobClient) createPreparer(contentLength int64, timeout *int3
if blobTagsString != nil {
req.Header.Set("x-ms-tags", *blobTagsString)
}
if immutabilityPolicyExpiry != nil {
req.Header.Set("x-ms-immutability-policy-until-date", (*immutabilityPolicyExpiry).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyMode != BlobImmutabilityPolicyModeNone {
req.Header.Set("x-ms-immutability-policy-mode", string(immutabilityPolicyMode))
}
if legalHold != nil {
req.Header.Set("x-ms-legal-hold", strconv.FormatBool(*legalHold))
}
req.Header.Set("x-ms-blob-type", "AppendBlob")
return req, nil
}

Просмотреть файл

@ -8,13 +8,14 @@ import (
"context"
"encoding/base64"
"encoding/xml"
"github.com/Azure/azure-pipeline-go/pipeline"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"time"
"github.com/Azure/azure-pipeline-go/pipeline"
)
// blobClient is the client for the Blob methods of the Azblob service.
@ -366,15 +367,17 @@ func (client blobClient) changeLeaseResponder(resp pipeline.Response) (pipeline.
// only succeeds if the resource's lease is active and matches this ID. requestID is provides a client-generated,
// opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is
// enabled. sourceContentMD5 is specify the md5 calculated for the range of bytes that must be read from the copy
// source. blobTagsString is optional. Used to set blob tags in various blob operations.
func (client blobClient) CopyFromURL(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string) (*BlobCopyFromURLResponse, error) {
// source. blobTagsString is optional. Used to set blob tags in various blob operations. immutabilityPolicyExpiry is
// specifies the date time when the blobs immutability policy is set to expire. immutabilityPolicyMode is specifies the
// immutability policy mode to set on the blob. legalHold is specified if a legal hold should be set on the blob.
func (client blobClient) CopyFromURL(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (*BlobCopyFromURLResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.copyFromURLPreparer(copySource, timeout, metadata, tier, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseID, requestID, sourceContentMD5, blobTagsString)
req, err := client.copyFromURLPreparer(copySource, timeout, metadata, tier, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseID, requestID, sourceContentMD5, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold)
if err != nil {
return nil, err
}
@ -386,7 +389,7 @@ func (client blobClient) CopyFromURL(ctx context.Context, copySource string, tim
}
// copyFromURLPreparer prepares the CopyFromURL request.
func (client blobClient) copyFromURLPreparer(copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string) (pipeline.Request, error) {
func (client blobClient) copyFromURLPreparer(copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, sourceContentMD5 []byte, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -445,6 +448,15 @@ func (client blobClient) copyFromURLPreparer(copySource string, timeout *int32,
if blobTagsString != nil {
req.Header.Set("x-ms-tags", *blobTagsString)
}
if immutabilityPolicyExpiry != nil {
req.Header.Set("x-ms-immutability-policy-until-date", (*immutabilityPolicyExpiry).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyMode != BlobImmutabilityPolicyModeNone {
req.Header.Set("x-ms-immutability-policy-mode", string(immutabilityPolicyMode))
}
if legalHold != nil {
req.Header.Set("x-ms-legal-hold", strconv.FormatBool(*legalHold))
}
req.Header.Set("x-ms-requires-sync", "true")
return req, nil
}
@ -674,6 +686,60 @@ func (client blobClient) deleteResponder(resp pipeline.Response) (pipeline.Respo
return &BlobDeleteResponse{rawResponse: resp.Response()}, err
}
// DeleteImmutabilityPolicy the Delete Immutability Policy operation deletes the immutability policy on the blob
//
// timeout is the timeout parameter is expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
func (client blobClient) DeleteImmutabilityPolicy(ctx context.Context, timeout *int32, requestID *string) (*BlobDeleteImmutabilityPolicyResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.deleteImmutabilityPolicyPreparer(timeout, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.deleteImmutabilityPolicyResponder}, req)
if err != nil {
return nil, err
}
return resp.(*BlobDeleteImmutabilityPolicyResponse), err
}
// deleteImmutabilityPolicyPreparer prepares the DeleteImmutabilityPolicy request.
func (client blobClient) deleteImmutabilityPolicyPreparer(timeout *int32, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("DELETE", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("comp", "immutabilityPolicies")
req.URL.RawQuery = params.Encode()
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
return req, nil
}
// deleteImmutabilityPolicyResponder handles the response to the DeleteImmutabilityPolicy request.
func (client blobClient) deleteImmutabilityPolicyResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &BlobDeleteImmutabilityPolicyResponse{rawResponse: resp.Response()}, err
}
// Download the Download operation reads or downloads a blob from the system, including its metadata and properties.
// You can also call Download to read a snapshot.
//
@ -1096,7 +1162,7 @@ func (client blobClient) getTagsResponder(resp pipeline.Response) (pipeline.Resp
return result, nil
}
// todo funky quick query code
// Funky Quick Query code
// // Query the Query operation enables users to select/project on blob data by providing simple query expressions.
// //
// // snapshot is the snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to
@ -1754,6 +1820,128 @@ func (client blobClient) setHTTPHeadersResponder(resp pipeline.Response) (pipeli
return &BlobSetHTTPHeadersResponse{rawResponse: resp.Response()}, err
}
// SetImmutabilityPolicy the Set Immutability Policy operation sets the immutability policy on the blob
//
// timeout is the timeout parameter is expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
// character limit that is recorded in the analytics logs when storage analytics logging is enabled. ifUnmodifiedSince
// is specify this header value to operate only on a blob if it has not been modified since the specified date/time.
// immutabilityPolicyExpiry is specifies the date time when the blobs immutability policy is set to expire.
// immutabilityPolicyMode is specifies the immutability policy mode to set on the blob.
func (client blobClient) SetImmutabilityPolicy(ctx context.Context, timeout *int32, requestID *string, ifUnmodifiedSince *time.Time, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType) (*BlobSetImmutabilityPolicyResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.setImmutabilityPolicyPreparer(timeout, requestID, ifUnmodifiedSince, immutabilityPolicyExpiry, immutabilityPolicyMode)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.setImmutabilityPolicyResponder}, req)
if err != nil {
return nil, err
}
return resp.(*BlobSetImmutabilityPolicyResponse), err
}
// setImmutabilityPolicyPreparer prepares the SetImmutabilityPolicy request.
func (client blobClient) setImmutabilityPolicyPreparer(timeout *int32, requestID *string, ifUnmodifiedSince *time.Time, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("comp", "immutabilityPolicies")
req.URL.RawQuery = params.Encode()
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyExpiry != nil {
req.Header.Set("x-ms-immutability-policy-until-date", (*immutabilityPolicyExpiry).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyMode != BlobImmutabilityPolicyModeNone {
req.Header.Set("x-ms-immutability-policy-mode", string(immutabilityPolicyMode))
}
return req, nil
}
// setImmutabilityPolicyResponder handles the response to the SetImmutabilityPolicy request.
func (client blobClient) setImmutabilityPolicyResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &BlobSetImmutabilityPolicyResponse{rawResponse: resp.Response()}, err
}
// SetLegalHold the Set Legal Hold operation sets a legal hold on the blob.
//
// legalHold is specified if a legal hold should be set on the blob. timeout is the timeout parameter is expressed in
// seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> requestID is provides a client-generated, opaque value with a 1 KB
// character limit that is recorded in the analytics logs when storage analytics logging is enabled.
func (client blobClient) SetLegalHold(ctx context.Context, legalHold bool, timeout *int32, requestID *string) (*BlobSetLegalHoldResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.setLegalHoldPreparer(legalHold, timeout, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.setLegalHoldResponder}, req)
if err != nil {
return nil, err
}
return resp.(*BlobSetLegalHoldResponse), err
}
// setLegalHoldPreparer prepares the SetLegalHold request.
func (client blobClient) setLegalHoldPreparer(legalHold bool, timeout *int32, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("comp", "legalhold")
req.URL.RawQuery = params.Encode()
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
req.Header.Set("x-ms-legal-hold", strconv.FormatBool(legalHold))
return req, nil
}
// setLegalHoldResponder handles the response to the SetLegalHold request.
func (client blobClient) setLegalHoldResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &BlobSetLegalHoldResponse{rawResponse: resp.Response()}, err
}
// SetMetadata the Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more
// name-value pairs
//
@ -2056,15 +2244,17 @@ func (client blobClient) setTierResponder(resp pipeline.Response) (pipeline.Resp
// only succeeds if the resource's lease is active and matches this ID. requestID is provides a client-generated,
// opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is
// enabled. blobTagsString is optional. Used to set blob tags in various blob operations. sealBlob is overrides the
// sealed state of the destination blob. Service version 2019-12-12 and newer.
func (client blobClient) StartCopyFromURL(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, rehydratePriority RehydratePriorityType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, sourceIfTags *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, blobTagsString *string, sealBlob *bool) (*BlobStartCopyFromURLResponse, error) {
// sealed state of the destination blob. Service version 2019-12-12 and newer. immutabilityPolicyExpiry is specifies
// the date time when the blobs immutability policy is set to expire. immutabilityPolicyMode is specifies the
// immutability policy mode to set on the blob. legalHold is specified if a legal hold should be set on the blob.
func (client blobClient) StartCopyFromURL(ctx context.Context, copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, rehydratePriority RehydratePriorityType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, sourceIfTags *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, blobTagsString *string, sealBlob *bool, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (*BlobStartCopyFromURLResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.startCopyFromURLPreparer(copySource, timeout, metadata, tier, rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseID, requestID, blobTagsString, sealBlob)
req, err := client.startCopyFromURLPreparer(copySource, timeout, metadata, tier, rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseID, requestID, blobTagsString, sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold)
if err != nil {
return nil, err
}
@ -2076,7 +2266,7 @@ func (client blobClient) StartCopyFromURL(ctx context.Context, copySource string
}
// startCopyFromURLPreparer prepares the StartCopyFromURL request.
func (client blobClient) startCopyFromURLPreparer(copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, rehydratePriority RehydratePriorityType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, sourceIfTags *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, blobTagsString *string, sealBlob *bool) (pipeline.Request, error) {
func (client blobClient) startCopyFromURLPreparer(copySource string, timeout *int32, metadata map[string]string, tier AccessTierType, rehydratePriority RehydratePriorityType, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, sourceIfTags *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, leaseID *string, requestID *string, blobTagsString *string, sealBlob *bool, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -2141,6 +2331,15 @@ func (client blobClient) startCopyFromURLPreparer(copySource string, timeout *in
if sealBlob != nil {
req.Header.Set("x-ms-seal-blob", strconv.FormatBool(*sealBlob))
}
if immutabilityPolicyExpiry != nil {
req.Header.Set("x-ms-immutability-policy-until-date", (*immutabilityPolicyExpiry).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyMode != BlobImmutabilityPolicyModeNone {
req.Header.Set("x-ms-immutability-policy-mode", string(immutabilityPolicyMode))
}
if legalHold != nil {
req.Header.Set("x-ms-legal-hold", strconv.FormatBool(*legalHold))
}
return req, nil
}

Просмотреть файл

@ -67,15 +67,17 @@ func newBlockBlobClient(url url.URL, p pipeline.Pipeline) blockBlobClient {
// matching value. ifTags is specify a SQL where clause on blob tags to operate only on blobs with a matching value.
// requestID is provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics
// logs when storage analytics logging is enabled. blobTagsString is optional. Used to set blob tags in various blob
// operations.
func (client blockBlobClient) CommitBlockList(ctx context.Context, blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string) (*BlockBlobCommitBlockListResponse, error) {
// operations. immutabilityPolicyExpiry is specifies the date time when the blobs immutability policy is set to expire.
// immutabilityPolicyMode is specifies the immutability policy mode to set on the blob. legalHold is specified if a
// legal hold should be set on the blob.
func (client blockBlobClient) CommitBlockList(ctx context.Context, blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (*BlockBlobCommitBlockListResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.commitBlockListPreparer(blocks, timeout, blobCacheControl, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, transactionalContentMD5, transactionalContentCrc64, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID, blobTagsString)
req, err := client.commitBlockListPreparer(blocks, timeout, blobCacheControl, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, transactionalContentMD5, transactionalContentCrc64, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold)
if err != nil {
return nil, err
}
@ -87,7 +89,7 @@ func (client blockBlobClient) CommitBlockList(ctx context.Context, blocks BlockL
}
// commitBlockListPreparer prepares the CommitBlockList request.
func (client blockBlobClient) commitBlockListPreparer(blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string) (pipeline.Request, error) {
func (client blockBlobClient) commitBlockListPreparer(blocks BlockLookupList, timeout *int32, blobCacheControl *string, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, transactionalContentMD5 []byte, transactionalContentCrc64 []byte, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -167,6 +169,15 @@ func (client blockBlobClient) commitBlockListPreparer(blocks BlockLookupList, ti
if blobTagsString != nil {
req.Header.Set("x-ms-tags", *blobTagsString)
}
if immutabilityPolicyExpiry != nil {
req.Header.Set("x-ms-immutability-policy-until-date", (*immutabilityPolicyExpiry).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyMode != BlobImmutabilityPolicyModeNone {
req.Header.Set("x-ms-immutability-policy-mode", string(immutabilityPolicyMode))
}
if legalHold != nil {
req.Header.Set("x-ms-legal-hold", strconv.FormatBool(*legalHold))
}
b, err := xml.Marshal(blocks)
if err != nil {
return req, pipeline.NewError(err, "failed to marshal request body")
@ -703,7 +714,10 @@ func (client blockBlobClient) stageBlockFromURLResponder(resp pipeline.Response)
// SQL where clause on blob tags to operate only on blobs with a matching value. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled. blobTagsString is optional. Used to set blob tags in various blob operations.
func (client blockBlobClient) Upload(ctx context.Context, body io.ReadSeeker, contentLength int64, timeout *int32, transactionalContentMD5 []byte, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string) (*BlockBlobUploadResponse, error) {
// immutabilityPolicyExpiry is specifies the date time when the blobs immutability policy is set to expire.
// immutabilityPolicyMode is specifies the immutability policy mode to set on the blob. legalHold is specified if a
// legal hold should be set on the blob.
func (client blockBlobClient) Upload(ctx context.Context, body io.ReadSeeker, contentLength int64, timeout *int32, transactionalContentMD5 []byte, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (*BlockBlobUploadResponse, error) {
if err := validate([]validation{
{targetValue: body,
constraints: []constraint{{target: "body", name: null, rule: true, chain: nil}}},
@ -712,7 +726,7 @@ func (client blockBlobClient) Upload(ctx context.Context, body io.ReadSeeker, co
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.uploadPreparer(body, contentLength, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID, blobTagsString)
req, err := client.uploadPreparer(body, contentLength, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestID, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold)
if err != nil {
return nil, err
}
@ -724,7 +738,7 @@ func (client blockBlobClient) Upload(ctx context.Context, body io.ReadSeeker, co
}
// uploadPreparer prepares the Upload request.
func (client blockBlobClient) uploadPreparer(body io.ReadSeeker, contentLength int64, timeout *int32, transactionalContentMD5 []byte, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string) (pipeline.Request, error) {
func (client blockBlobClient) uploadPreparer(body io.ReadSeeker, contentLength int64, timeout *int32, transactionalContentMD5 []byte, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, tier AccessTierType, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, body)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -801,6 +815,15 @@ func (client blockBlobClient) uploadPreparer(body io.ReadSeeker, contentLength i
if blobTagsString != nil {
req.Header.Set("x-ms-tags", *blobTagsString)
}
if immutabilityPolicyExpiry != nil {
req.Header.Set("x-ms-immutability-policy-until-date", (*immutabilityPolicyExpiry).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyMode != BlobImmutabilityPolicyModeNone {
req.Header.Set("x-ms-immutability-policy-mode", string(immutabilityPolicyMode))
}
if legalHold != nil {
req.Header.Set("x-ms-legal-hold", strconv.FormatBool(*legalHold))
}
req.Header.Set("x-ms-blob-type", "BlockBlob")
return req, nil
}

Просмотреть файл

@ -4,13 +4,14 @@ package azblob
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/azure-pipeline-go/pipeline"
"net/url"
"github.com/Azure/azure-pipeline-go/pipeline"
)
const (
// ServiceVersion specifies the version of the operations used in this package.
ServiceVersion = "2020-04-08"
ServiceVersion = "2020-08-04"
)
// managementClient is the base client for Azblob.

Просмотреть файл

@ -7,13 +7,14 @@ import (
"bytes"
"context"
"encoding/xml"
"github.com/Azure/azure-pipeline-go/pipeline"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"time"
"github.com/Azure/azure-pipeline-go/pipeline"
)
// containerClient is the client for the Container methods of the Azblob service.

Просмотреть файл

@ -0,0 +1,541 @@
package azblob
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"time"
"github.com/Azure/azure-pipeline-go/pipeline"
)
// directoryClient is the client for the Directory methods of the Azblob service.
type directoryClient struct {
managementClient
}
// newDirectoryClient creates an instance of the directoryClient client.
func newDirectoryClient(url url.URL, p pipeline.Pipeline) directoryClient {
return directoryClient{newManagementClient(url, p)}
}
// Create create a directory. By default, the destination is overwritten and if the destination already exists and has
// a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see
// [Specifying Conditional Headers for Blob Service
// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
// To fail if the destination already exists, use a conditional request with If-None-Match: "*".
//
// timeout is the timeout parameter is expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> directoryProperties is optional. User-defined properties to be stored
// with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...",
// where each value is base64 encoded. posixPermissions is optional and only valid if Hierarchical Namespace is enabled
// for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may
// be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and
// 4-digit octal notation (e.g. 0766) are supported. posixUmask is only valid if Hierarchical Namespace is enabled for
// the account. This umask restricts permission settings for file and directory, and will only be applied when default
// Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be
// disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation
// (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used. cacheControl is cache
// control for given resource contentType is content type for given resource contentEncoding is content encoding for
// given resource contentLanguage is content language for given resource contentDisposition is content disposition for
// given resource leaseID is if specified, the operation only succeeds if the resource's lease is active and matches
// this ID. ifModifiedSince is specify this header value to operate only on a blob if it has been modified since the
// specified date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if it has not been
// modified since the specified date/time. ifMatch is specify an ETag value to operate only on blobs with a matching
// value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. requestID is provides
// a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled.
func (client directoryClient) Create(ctx context.Context, timeout *int32, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (*DirectoryCreateResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.createPreparer(timeout, directoryProperties, posixPermissions, posixUmask, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.createResponder}, req)
if err != nil {
return nil, err
}
return resp.(*DirectoryCreateResponse), err
}
// createPreparer prepares the Create request.
func (client directoryClient) createPreparer(timeout *int32, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("resource", "directory")
req.URL.RawQuery = params.Encode()
if directoryProperties != nil {
req.Header.Set("x-ms-properties", *directoryProperties)
}
if posixPermissions != nil {
req.Header.Set("x-ms-permissions", *posixPermissions)
}
if posixUmask != nil {
req.Header.Set("x-ms-umask", *posixUmask)
}
if cacheControl != nil {
req.Header.Set("x-ms-cache-control", *cacheControl)
}
if contentType != nil {
req.Header.Set("x-ms-content-type", *contentType)
}
if contentEncoding != nil {
req.Header.Set("x-ms-content-encoding", *contentEncoding)
}
if contentLanguage != nil {
req.Header.Set("x-ms-content-language", *contentLanguage)
}
if contentDisposition != nil {
req.Header.Set("x-ms-content-disposition", *contentDisposition)
}
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if ifModifiedSince != nil {
req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if ifMatch != nil {
req.Header.Set("If-Match", string(*ifMatch))
}
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
return req, nil
}
// createResponder handles the response to the Create request.
func (client directoryClient) createResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &DirectoryCreateResponse{rawResponse: resp.Response()}, err
}
// Delete deletes the directory
//
// recursiveDirectoryDelete is if "true", all paths beneath the directory will be deleted. If "false" and the directory
// is non-empty, an error occurs. timeout is the timeout parameter is expressed in seconds. For more information, see
// <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> marker is when renaming a directory, the number of paths that are renamed
// with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is
// returned in this response header. When a continuation token is returned in the response, it must be specified in a
// subsequent invocation of the rename operation to continue renaming the directory. leaseID is if specified, the
// operation only succeeds if the resource's lease is active and matches this ID. ifModifiedSince is specify this
// header value to operate only on a blob if it has been modified since the specified date/time. ifUnmodifiedSince is
// specify this header value to operate only on a blob if it has not been modified since the specified date/time.
// ifMatch is specify an ETag value to operate only on blobs with a matching value. ifNoneMatch is specify an ETag
// value to operate only on blobs without a matching value. requestID is provides a client-generated, opaque value with
// a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled.
func (client directoryClient) Delete(ctx context.Context, recursiveDirectoryDelete bool, timeout *int32, marker *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (*DirectoryDeleteResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.deletePreparer(recursiveDirectoryDelete, timeout, marker, leaseID, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.deleteResponder}, req)
if err != nil {
return nil, err
}
return resp.(*DirectoryDeleteResponse), err
}
// deletePreparer prepares the Delete request.
func (client directoryClient) deletePreparer(recursiveDirectoryDelete bool, timeout *int32, marker *string, leaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("DELETE", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("recursive", strconv.FormatBool(recursiveDirectoryDelete))
if marker != nil && len(*marker) > 0 {
params.Set("continuation", *marker)
}
req.URL.RawQuery = params.Encode()
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if ifModifiedSince != nil {
req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if ifMatch != nil {
req.Header.Set("If-Match", string(*ifMatch))
}
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
return req, nil
}
// deleteResponder handles the response to the Delete request.
func (client directoryClient) deleteResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &DirectoryDeleteResponse{rawResponse: resp.Response()}, err
}
// GetAccessControl get the owner, group, permissions, or access control list for a directory.
//
// timeout is the timeout parameter is expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> upn is optional. Valid only when Hierarchical Namespace is enabled for the
// account. If "true", the identity values returned in the x-ms-owner, x-ms-group, and x-ms-acl response headers will
// be transformed from Azure Active Directory Object IDs to User Principal Names. If "false", the values will be
// returned as Azure Active Directory Object IDs. The default value is false. leaseID is if specified, the operation
// only succeeds if the resource's lease is active and matches this ID. ifMatch is specify an ETag value to operate
// only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only on blobs without a
// matching value. ifModifiedSince is specify this header value to operate only on a blob if it has been modified since
// the specified date/time. ifUnmodifiedSince is specify this header value to operate only on a blob if it has not been
// modified since the specified date/time. requestID is provides a client-generated, opaque value with a 1 KB character
// limit that is recorded in the analytics logs when storage analytics logging is enabled.
func (client directoryClient) GetAccessControl(ctx context.Context, timeout *int32, upn *bool, leaseID *string, ifMatch *ETag, ifNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (*DirectoryGetAccessControlResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.getAccessControlPreparer(timeout, upn, leaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.getAccessControlResponder}, req)
if err != nil {
return nil, err
}
return resp.(*DirectoryGetAccessControlResponse), err
}
// getAccessControlPreparer prepares the GetAccessControl request.
func (client directoryClient) getAccessControlPreparer(timeout *int32, upn *bool, leaseID *string, ifMatch *ETag, ifNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("HEAD", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
if upn != nil {
params.Set("upn", strconv.FormatBool(*upn))
}
params.Set("action", "getAccessControl")
req.URL.RawQuery = params.Encode()
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if ifMatch != nil {
req.Header.Set("If-Match", string(*ifMatch))
}
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if ifModifiedSince != nil {
req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
req.Header.Set("x-ms-version", ServiceVersion)
return req, nil
}
// getAccessControlResponder handles the response to the GetAccessControl request.
func (client directoryClient) getAccessControlResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &DirectoryGetAccessControlResponse{rawResponse: resp.Response()}, err
}
// Rename rename a directory. By default, the destination is overwritten and if the destination already exists and has
// a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see
// [Specifying Conditional Headers for Blob Service
// Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
// To fail if the destination already exists, use a conditional request with If-None-Match: "*".
//
// renameSource is the file or directory to be renamed. The value must have the following format:
// "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties;
// otherwise, the existing properties will be preserved. timeout is the timeout parameter is expressed in seconds. For
// more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> marker is when renaming a directory, the number of paths that are renamed
// with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is
// returned in this response header. When a continuation token is returned in the response, it must be specified in a
// subsequent invocation of the rename operation to continue renaming the directory. directoryProperties is optional.
// User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and
// value pairs "n1=v1, n2=v2, ...", where each value is base64 encoded. posixPermissions is optional and only valid if
// Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning
// group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported.
// Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. posixUmask is only valid if
// Hierarchical Namespace is enabled for the account. This umask restricts permission settings for file and directory,
// and will only be applied when default Acl does not exist in parent directory. If the umask bit has set, it means
// that the corresponding permission will be disabled. Otherwise the corresponding permission will be determined by the
// permission. A 4-digit octal notation (e.g. 0022) is supported here. If no umask was specified, a default umask -
// 0027 will be used. cacheControl is cache control for given resource contentType is content type for given resource
// contentEncoding is content encoding for given resource contentLanguage is content language for given resource
// contentDisposition is content disposition for given resource leaseID is if specified, the operation only succeeds if
// the resource's lease is active and matches this ID. sourceLeaseID is a lease ID for the source path. If specified,
// the source path must have an active lease and the lease ID must match. ifModifiedSince is specify this header value
// to operate only on a blob if it has been modified since the specified date/time. ifUnmodifiedSince is specify this
// header value to operate only on a blob if it has not been modified since the specified date/time. ifMatch is specify
// an ETag value to operate only on blobs with a matching value. ifNoneMatch is specify an ETag value to operate only
// on blobs without a matching value. sourceIfModifiedSince is specify this header value to operate only on a blob if
// it has been modified since the specified date/time. sourceIfUnmodifiedSince is specify this header value to operate
// only on a blob if it has not been modified since the specified date/time. sourceIfMatch is specify an ETag value to
// operate only on blobs with a matching value. sourceIfNoneMatch is specify an ETag value to operate only on blobs
// without a matching value. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
// recorded in the analytics logs when storage analytics logging is enabled.
func (client directoryClient) Rename(ctx context.Context, renameSource string, timeout *int32, marker *string, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, sourceLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, requestID *string) (*DirectoryRenameResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.renamePreparer(renameSource, timeout, marker, directoryProperties, posixPermissions, posixUmask, cacheControl, contentType, contentEncoding, contentLanguage, contentDisposition, leaseID, sourceLeaseID, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.renameResponder}, req)
if err != nil {
return nil, err
}
return resp.(*DirectoryRenameResponse), err
}
// renamePreparer prepares the Rename request.
func (client directoryClient) renamePreparer(renameSource string, timeout *int32, marker *string, directoryProperties *string, posixPermissions *string, posixUmask *string, cacheControl *string, contentType *string, contentEncoding *string, contentLanguage *string, contentDisposition *string, leaseID *string, sourceLeaseID *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, sourceIfModifiedSince *time.Time, sourceIfUnmodifiedSince *time.Time, sourceIfMatch *ETag, sourceIfNoneMatch *ETag, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
if marker != nil && len(*marker) > 0 {
params.Set("continuation", *marker)
}
// if pathRenameMode != PathRenameModeNone {
// params.Set("mode", string(client.PathRenameMode))
// }
req.URL.RawQuery = params.Encode()
req.Header.Set("x-ms-rename-source", renameSource)
if directoryProperties != nil {
req.Header.Set("x-ms-properties", *directoryProperties)
}
if posixPermissions != nil {
req.Header.Set("x-ms-permissions", *posixPermissions)
}
if posixUmask != nil {
req.Header.Set("x-ms-umask", *posixUmask)
}
if cacheControl != nil {
req.Header.Set("x-ms-cache-control", *cacheControl)
}
if contentType != nil {
req.Header.Set("x-ms-content-type", *contentType)
}
if contentEncoding != nil {
req.Header.Set("x-ms-content-encoding", *contentEncoding)
}
if contentLanguage != nil {
req.Header.Set("x-ms-content-language", *contentLanguage)
}
if contentDisposition != nil {
req.Header.Set("x-ms-content-disposition", *contentDisposition)
}
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if sourceLeaseID != nil {
req.Header.Set("x-ms-source-lease-id", *sourceLeaseID)
}
if ifModifiedSince != nil {
req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if ifMatch != nil {
req.Header.Set("If-Match", string(*ifMatch))
}
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if sourceIfModifiedSince != nil {
req.Header.Set("x-ms-source-if-modified-since", (*sourceIfModifiedSince).In(gmt).Format(time.RFC1123))
}
if sourceIfUnmodifiedSince != nil {
req.Header.Set("x-ms-source-if-unmodified-since", (*sourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if sourceIfMatch != nil {
req.Header.Set("x-ms-source-if-match", string(*sourceIfMatch))
}
if sourceIfNoneMatch != nil {
req.Header.Set("x-ms-source-if-none-match", string(*sourceIfNoneMatch))
}
req.Header.Set("x-ms-version", ServiceVersion)
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
return req, nil
}
// renameResponder handles the response to the Rename request.
func (client directoryClient) renameResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK, http.StatusCreated)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &DirectoryRenameResponse{rawResponse: resp.Response()}, err
}
// SetAccessControl set the owner, group, permissions, or access control list for a directory.
//
// timeout is the timeout parameter is expressed in seconds. For more information, see <a
// href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
// Timeouts for Blob Service Operations.</a> leaseID is if specified, the operation only succeeds if the resource's
// lease is active and matches this ID. owner is optional. The owner of the blob or directory. group is optional. The
// owning group of the blob or directory. posixPermissions is optional and only valid if Hierarchical Namespace is
// enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each
// class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic
// (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. posixACL is sets POSIX access control rights on
// files and directories. The value is a comma-separated list of access control entries. Each access control entry
// (ACE) consists of a scope, a type, a user or group identifier, and permissions in the format
// "[scope:][type]:[id]:[permissions]". ifMatch is specify an ETag value to operate only on blobs with a matching
// value. ifNoneMatch is specify an ETag value to operate only on blobs without a matching value. ifModifiedSince is
// specify this header value to operate only on a blob if it has been modified since the specified date/time.
// ifUnmodifiedSince is specify this header value to operate only on a blob if it has not been modified since the
// specified date/time. requestID is provides a client-generated, opaque value with a 1 KB character limit that is
// recorded in the analytics logs when storage analytics logging is enabled.
func (client directoryClient) SetAccessControl(ctx context.Context, timeout *int32, leaseID *string, owner *string, group *string, posixPermissions *string, posixACL *string, ifMatch *ETag, ifNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (*DirectorySetAccessControlResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.setAccessControlPreparer(timeout, leaseID, owner, group, posixPermissions, posixACL, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, requestID)
if err != nil {
return nil, err
}
resp, err := client.Pipeline().Do(ctx, responderPolicyFactory{responder: client.setAccessControlResponder}, req)
if err != nil {
return nil, err
}
return resp.(*DirectorySetAccessControlResponse), err
}
// setAccessControlPreparer prepares the SetAccessControl request.
func (client directoryClient) setAccessControlPreparer(timeout *int32, leaseID *string, owner *string, group *string, posixPermissions *string, posixACL *string, ifMatch *ETag, ifNoneMatch *ETag, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, requestID *string) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PATCH", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
}
params := req.URL.Query()
if timeout != nil {
params.Set("timeout", strconv.FormatInt(int64(*timeout), 10))
}
params.Set("action", "setAccessControl")
req.URL.RawQuery = params.Encode()
if leaseID != nil {
req.Header.Set("x-ms-lease-id", *leaseID)
}
if owner != nil {
req.Header.Set("x-ms-owner", *owner)
}
if group != nil {
req.Header.Set("x-ms-group", *group)
}
if posixPermissions != nil {
req.Header.Set("x-ms-permissions", *posixPermissions)
}
if posixACL != nil {
req.Header.Set("x-ms-acl", *posixACL)
}
if ifMatch != nil {
req.Header.Set("If-Match", string(*ifMatch))
}
if ifNoneMatch != nil {
req.Header.Set("If-None-Match", string(*ifNoneMatch))
}
if ifModifiedSince != nil {
req.Header.Set("If-Modified-Since", (*ifModifiedSince).In(gmt).Format(time.RFC1123))
}
if ifUnmodifiedSince != nil {
req.Header.Set("If-Unmodified-Since", (*ifUnmodifiedSince).In(gmt).Format(time.RFC1123))
}
if requestID != nil {
req.Header.Set("x-ms-client-request-id", *requestID)
}
req.Header.Set("x-ms-version", ServiceVersion)
return req, nil
}
// setAccessControlResponder handles the response to the SetAccessControl request.
func (client directoryClient) setAccessControlResponder(resp pipeline.Response) (pipeline.Response, error) {
err := validateResponse(resp, http.StatusOK)
if resp == nil {
return nil, err
}
io.Copy(ioutil.Discard, resp.Response().Body)
resp.Response().Body.Close()
return &DirectorySetAccessControlResponse{rawResponse: resp.Response()}, err
}

Просмотреть файл

@ -210,6 +210,25 @@ func PossibleBlobExpiryOptionsTypeValues() []BlobExpiryOptionsType {
return []BlobExpiryOptionsType{BlobExpiryOptionsAbsolute, BlobExpiryOptionsNeverExpire, BlobExpiryOptionsNone, BlobExpiryOptionsRelativeToCreation, BlobExpiryOptionsRelativeToNow}
}
// BlobImmutabilityPolicyModeType enumerates the values for blob immutability policy mode type.
type BlobImmutabilityPolicyModeType string
const (
// BlobImmutabilityPolicyModeLocked ...
BlobImmutabilityPolicyModeLocked BlobImmutabilityPolicyModeType = "Locked"
// BlobImmutabilityPolicyModeMutable ...
BlobImmutabilityPolicyModeMutable BlobImmutabilityPolicyModeType = "Mutable"
// BlobImmutabilityPolicyModeNone represents an empty BlobImmutabilityPolicyModeType.
BlobImmutabilityPolicyModeNone BlobImmutabilityPolicyModeType = ""
// BlobImmutabilityPolicyModeUnlocked ...
BlobImmutabilityPolicyModeUnlocked BlobImmutabilityPolicyModeType = "Unlocked"
)
// PossibleBlobImmutabilityPolicyModeTypeValues returns an array of possible values for the BlobImmutabilityPolicyModeType const type.
func PossibleBlobImmutabilityPolicyModeTypeValues() []BlobImmutabilityPolicyModeType {
return []BlobImmutabilityPolicyModeType{BlobImmutabilityPolicyModeLocked, BlobImmutabilityPolicyModeMutable, BlobImmutabilityPolicyModeNone, BlobImmutabilityPolicyModeUnlocked}
}
// BlobType enumerates the values for blob type.
type BlobType string
@ -385,6 +404,10 @@ const (
ListBlobsIncludeItemCopy ListBlobsIncludeItemType = "copy"
// ListBlobsIncludeItemDeleted ...
ListBlobsIncludeItemDeleted ListBlobsIncludeItemType = "deleted"
// ListBlobsIncludeItemImmutabilitypolicy ...
ListBlobsIncludeItemImmutabilitypolicy ListBlobsIncludeItemType = "immutabilitypolicy"
// ListBlobsIncludeItemLegalhold ...
ListBlobsIncludeItemLegalhold ListBlobsIncludeItemType = "legalhold"
// ListBlobsIncludeItemMetadata ...
ListBlobsIncludeItemMetadata ListBlobsIncludeItemType = "metadata"
// ListBlobsIncludeItemNone represents an empty ListBlobsIncludeItemType.
@ -401,7 +424,7 @@ const (
// PossibleListBlobsIncludeItemTypeValues returns an array of possible values for the ListBlobsIncludeItemType const type.
func PossibleListBlobsIncludeItemTypeValues() []ListBlobsIncludeItemType {
return []ListBlobsIncludeItemType{ListBlobsIncludeItemCopy, ListBlobsIncludeItemDeleted, ListBlobsIncludeItemMetadata, ListBlobsIncludeItemNone, ListBlobsIncludeItemSnapshots, ListBlobsIncludeItemTags, ListBlobsIncludeItemUncommittedblobs, ListBlobsIncludeItemVersions}
return []ListBlobsIncludeItemType{ListBlobsIncludeItemCopy, ListBlobsIncludeItemDeleted, ListBlobsIncludeItemImmutabilitypolicy, ListBlobsIncludeItemLegalhold, ListBlobsIncludeItemMetadata, ListBlobsIncludeItemNone, ListBlobsIncludeItemSnapshots, ListBlobsIncludeItemTags, ListBlobsIncludeItemUncommittedblobs, ListBlobsIncludeItemVersions}
}
// ListContainersIncludeType enumerates the values for list containers include type.
@ -502,11 +525,13 @@ const (
QueryFormatJSON QueryFormatType = "json"
// QueryFormatNone represents an empty QueryFormatType.
QueryFormatNone QueryFormatType = ""
// QueryFormatParquet ...
QueryFormatParquet QueryFormatType = "parquet"
)
// PossibleQueryFormatTypeValues returns an array of possible values for the QueryFormatType const type.
func PossibleQueryFormatTypeValues() []QueryFormatType {
return []QueryFormatType{QueryFormatArrow, QueryFormatDelimited, QueryFormatJSON, QueryFormatNone}
return []QueryFormatType{QueryFormatArrow, QueryFormatDelimited, QueryFormatJSON, QueryFormatNone, QueryFormatParquet}
}
// RehydratePriorityType enumerates the values for rehydrate priority type.
@ -610,6 +635,8 @@ const (
StorageErrorCodeBlobOverwritten StorageErrorCodeType = "BlobOverwritten"
// StorageErrorCodeBlobTierInadequateForContentLength ...
StorageErrorCodeBlobTierInadequateForContentLength StorageErrorCodeType = "BlobTierInadequateForContentLength"
// StorageErrorCodeBlobUsesCustomerSpecifiedEncryption ...
StorageErrorCodeBlobUsesCustomerSpecifiedEncryption StorageErrorCodeType = "BlobUsesCustomerSpecifiedEncryption"
// StorageErrorCodeBlockCountExceedsLimit ...
StorageErrorCodeBlockCountExceedsLimit StorageErrorCodeType = "BlockCountExceedsLimit"
// StorageErrorCodeBlockListTooLong ...
@ -802,7 +829,7 @@ const (
// PossibleStorageErrorCodeTypeValues returns an array of possible values for the StorageErrorCodeType const type.
func PossibleStorageErrorCodeTypeValues() []StorageErrorCodeType {
return []StorageErrorCodeType{StorageErrorCodeAccountAlreadyExists, StorageErrorCodeAccountBeingCreated, StorageErrorCodeAccountIsDisabled, StorageErrorCodeAppendPositionConditionNotMet, StorageErrorCodeAuthenticationFailed, StorageErrorCodeAuthorizationFailure, StorageErrorCodeAuthorizationPermissionMismatch, StorageErrorCodeAuthorizationProtocolMismatch, StorageErrorCodeAuthorizationResourceTypeMismatch, StorageErrorCodeAuthorizationServiceMismatch, StorageErrorCodeAuthorizationSourceIPMismatch, StorageErrorCodeBlobAlreadyExists, StorageErrorCodeBlobArchived, StorageErrorCodeBlobBeingRehydrated, StorageErrorCodeBlobImmutableDueToPolicy, StorageErrorCodeBlobNotArchived, StorageErrorCodeBlobNotFound, StorageErrorCodeBlobOverwritten, StorageErrorCodeBlobTierInadequateForContentLength, StorageErrorCodeBlockCountExceedsLimit, StorageErrorCodeBlockListTooLong, StorageErrorCodeCannotChangeToLowerTier, StorageErrorCodeCannotVerifyCopySource, StorageErrorCodeConditionHeadersNotSupported, StorageErrorCodeConditionNotMet, StorageErrorCodeContainerAlreadyExists, StorageErrorCodeContainerBeingDeleted, StorageErrorCodeContainerDisabled, StorageErrorCodeContainerNotFound, StorageErrorCodeContentLengthLargerThanTierLimit, StorageErrorCodeCopyAcrossAccountsNotSupported, StorageErrorCodeCopyIDMismatch, StorageErrorCodeEmptyMetadataKey, StorageErrorCodeFeatureVersionMismatch, StorageErrorCodeIncrementalCopyBlobMismatch, StorageErrorCodeIncrementalCopyOfEralierVersionSnapshotNotAllowed, StorageErrorCodeIncrementalCopySourceMustBeSnapshot, StorageErrorCodeInfiniteLeaseDurationRequired, StorageErrorCodeInsufficientAccountPermissions, StorageErrorCodeInternalError, StorageErrorCodeInvalidAuthenticationInfo, StorageErrorCodeInvalidBlobOrBlock, StorageErrorCodeInvalidBlobTier, StorageErrorCodeInvalidBlobType, StorageErrorCodeInvalidBlockID, StorageErrorCodeInvalidBlockList, StorageErrorCodeInvalidHeaderValue, StorageErrorCodeInvalidHTTPVerb, StorageErrorCodeInvalidInput, StorageErrorCodeInvalidMd5, StorageErrorCodeInvalidMetadata, StorageErrorCodeInvalidOperation, StorageErrorCodeInvalidPageRange, StorageErrorCodeInvalidQueryParameterValue, StorageErrorCodeInvalidRange, StorageErrorCodeInvalidResourceName, StorageErrorCodeInvalidSourceBlobType, StorageErrorCodeInvalidSourceBlobURL, StorageErrorCodeInvalidURI, StorageErrorCodeInvalidVersionForPageBlobOperation, StorageErrorCodeInvalidXMLDocument, StorageErrorCodeInvalidXMLNodeValue, StorageErrorCodeLeaseAlreadyBroken, StorageErrorCodeLeaseAlreadyPresent, StorageErrorCodeLeaseIDMismatchWithBlobOperation, StorageErrorCodeLeaseIDMismatchWithContainerOperation, StorageErrorCodeLeaseIDMismatchWithLeaseOperation, StorageErrorCodeLeaseIDMissing, StorageErrorCodeLeaseIsBreakingAndCannotBeAcquired, StorageErrorCodeLeaseIsBreakingAndCannotBeChanged, StorageErrorCodeLeaseIsBrokenAndCannotBeRenewed, StorageErrorCodeLeaseLost, StorageErrorCodeLeaseNotPresentWithBlobOperation, StorageErrorCodeLeaseNotPresentWithContainerOperation, StorageErrorCodeLeaseNotPresentWithLeaseOperation, StorageErrorCodeMaxBlobSizeConditionNotMet, StorageErrorCodeMd5Mismatch, StorageErrorCodeMetadataTooLarge, StorageErrorCodeMissingContentLengthHeader, StorageErrorCodeMissingRequiredHeader, StorageErrorCodeMissingRequiredQueryParameter, StorageErrorCodeMissingRequiredXMLNode, StorageErrorCodeMultipleConditionHeadersNotSupported, StorageErrorCodeNoAuthenticationInformation, StorageErrorCodeNone, StorageErrorCodeNoPendingCopyOperation, StorageErrorCodeOperationNotAllowedOnIncrementalCopyBlob, StorageErrorCodeOperationTimedOut, StorageErrorCodeOutOfRangeInput, StorageErrorCodeOutOfRangeQueryParameterValue, StorageErrorCodePendingCopyOperation, StorageErrorCodePreviousSnapshotCannotBeNewer, StorageErrorCodePreviousSnapshotNotFound, StorageErrorCodePreviousSnapshotOperationNotSupported, StorageErrorCodeRequestBodyTooLarge, StorageErrorCodeRequestURLFailedToParse, StorageErrorCodeResourceAlreadyExists, StorageErrorCodeResourceNotFound, StorageErrorCodeResourceTypeMismatch, StorageErrorCodeSequenceNumberConditionNotMet, StorageErrorCodeSequenceNumberIncrementTooLarge, StorageErrorCodeServerBusy, StorageErrorCodeSnaphotOperationRateExceeded, StorageErrorCodeSnapshotCountExceeded, StorageErrorCodeSnapshotsPresent, StorageErrorCodeSourceConditionNotMet, StorageErrorCodeSystemInUse, StorageErrorCodeTargetConditionNotMet, StorageErrorCodeUnauthorizedBlobOverwrite, StorageErrorCodeUnsupportedHeader, StorageErrorCodeUnsupportedHTTPVerb, StorageErrorCodeUnsupportedQueryParameter, StorageErrorCodeUnsupportedXMLNode}
return []StorageErrorCodeType{StorageErrorCodeAccountAlreadyExists, StorageErrorCodeAccountBeingCreated, StorageErrorCodeAccountIsDisabled, StorageErrorCodeAppendPositionConditionNotMet, StorageErrorCodeAuthenticationFailed, StorageErrorCodeAuthorizationFailure, StorageErrorCodeAuthorizationPermissionMismatch, StorageErrorCodeAuthorizationProtocolMismatch, StorageErrorCodeAuthorizationResourceTypeMismatch, StorageErrorCodeAuthorizationServiceMismatch, StorageErrorCodeAuthorizationSourceIPMismatch, StorageErrorCodeBlobAlreadyExists, StorageErrorCodeBlobArchived, StorageErrorCodeBlobBeingRehydrated, StorageErrorCodeBlobImmutableDueToPolicy, StorageErrorCodeBlobNotArchived, StorageErrorCodeBlobNotFound, StorageErrorCodeBlobOverwritten, StorageErrorCodeBlobTierInadequateForContentLength, StorageErrorCodeBlobUsesCustomerSpecifiedEncryption, StorageErrorCodeBlockCountExceedsLimit, StorageErrorCodeBlockListTooLong, StorageErrorCodeCannotChangeToLowerTier, StorageErrorCodeCannotVerifyCopySource, StorageErrorCodeConditionHeadersNotSupported, StorageErrorCodeConditionNotMet, StorageErrorCodeContainerAlreadyExists, StorageErrorCodeContainerBeingDeleted, StorageErrorCodeContainerDisabled, StorageErrorCodeContainerNotFound, StorageErrorCodeContentLengthLargerThanTierLimit, StorageErrorCodeCopyAcrossAccountsNotSupported, StorageErrorCodeCopyIDMismatch, StorageErrorCodeEmptyMetadataKey, StorageErrorCodeFeatureVersionMismatch, StorageErrorCodeIncrementalCopyBlobMismatch, StorageErrorCodeIncrementalCopyOfEralierVersionSnapshotNotAllowed, StorageErrorCodeIncrementalCopySourceMustBeSnapshot, StorageErrorCodeInfiniteLeaseDurationRequired, StorageErrorCodeInsufficientAccountPermissions, StorageErrorCodeInternalError, StorageErrorCodeInvalidAuthenticationInfo, StorageErrorCodeInvalidBlobOrBlock, StorageErrorCodeInvalidBlobTier, StorageErrorCodeInvalidBlobType, StorageErrorCodeInvalidBlockID, StorageErrorCodeInvalidBlockList, StorageErrorCodeInvalidHeaderValue, StorageErrorCodeInvalidHTTPVerb, StorageErrorCodeInvalidInput, StorageErrorCodeInvalidMd5, StorageErrorCodeInvalidMetadata, StorageErrorCodeInvalidOperation, StorageErrorCodeInvalidPageRange, StorageErrorCodeInvalidQueryParameterValue, StorageErrorCodeInvalidRange, StorageErrorCodeInvalidResourceName, StorageErrorCodeInvalidSourceBlobType, StorageErrorCodeInvalidSourceBlobURL, StorageErrorCodeInvalidURI, StorageErrorCodeInvalidVersionForPageBlobOperation, StorageErrorCodeInvalidXMLDocument, StorageErrorCodeInvalidXMLNodeValue, StorageErrorCodeLeaseAlreadyBroken, StorageErrorCodeLeaseAlreadyPresent, StorageErrorCodeLeaseIDMismatchWithBlobOperation, StorageErrorCodeLeaseIDMismatchWithContainerOperation, StorageErrorCodeLeaseIDMismatchWithLeaseOperation, StorageErrorCodeLeaseIDMissing, StorageErrorCodeLeaseIsBreakingAndCannotBeAcquired, StorageErrorCodeLeaseIsBreakingAndCannotBeChanged, StorageErrorCodeLeaseIsBrokenAndCannotBeRenewed, StorageErrorCodeLeaseLost, StorageErrorCodeLeaseNotPresentWithBlobOperation, StorageErrorCodeLeaseNotPresentWithContainerOperation, StorageErrorCodeLeaseNotPresentWithLeaseOperation, StorageErrorCodeMaxBlobSizeConditionNotMet, StorageErrorCodeMd5Mismatch, StorageErrorCodeMetadataTooLarge, StorageErrorCodeMissingContentLengthHeader, StorageErrorCodeMissingRequiredHeader, StorageErrorCodeMissingRequiredQueryParameter, StorageErrorCodeMissingRequiredXMLNode, StorageErrorCodeMultipleConditionHeadersNotSupported, StorageErrorCodeNoAuthenticationInformation, StorageErrorCodeNone, StorageErrorCodeNoPendingCopyOperation, StorageErrorCodeOperationNotAllowedOnIncrementalCopyBlob, StorageErrorCodeOperationTimedOut, StorageErrorCodeOutOfRangeInput, StorageErrorCodeOutOfRangeQueryParameterValue, StorageErrorCodePendingCopyOperation, StorageErrorCodePreviousSnapshotCannotBeNewer, StorageErrorCodePreviousSnapshotNotFound, StorageErrorCodePreviousSnapshotOperationNotSupported, StorageErrorCodeRequestBodyTooLarge, StorageErrorCodeRequestURLFailedToParse, StorageErrorCodeResourceAlreadyExists, StorageErrorCodeResourceNotFound, StorageErrorCodeResourceTypeMismatch, StorageErrorCodeSequenceNumberConditionNotMet, StorageErrorCodeSequenceNumberIncrementTooLarge, StorageErrorCodeServerBusy, StorageErrorCodeSnaphotOperationRateExceeded, StorageErrorCodeSnapshotCountExceeded, StorageErrorCodeSnapshotsPresent, StorageErrorCodeSourceConditionNotMet, StorageErrorCodeSystemInUse, StorageErrorCodeTargetConditionNotMet, StorageErrorCodeUnauthorizedBlobOverwrite, StorageErrorCodeUnsupportedHeader, StorageErrorCodeUnsupportedHTTPVerb, StorageErrorCodeUnsupportedQueryParameter, StorageErrorCodeUnsupportedXMLNode}
}
// SyncCopyStatusType enumerates the values for sync copy status type.
@ -1277,12 +1304,13 @@ func (absr AppendBlobSealResponse) Version() string {
return absr.rawResponse.Header.Get("x-ms-version")
}
// ArrowConfiguration - arrow configuration
// ArrowConfiguration - Groups the settings used for formatting the response if the response should be Arrow
// formatted.
type ArrowConfiguration struct {
Schema []ArrowField `xml:"Schema>Field"`
}
// ArrowField - field of an arrow schema
// ArrowField - Groups settings regarding specific field of an arrow schema
type ArrowField struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Field"`
@ -1779,6 +1807,59 @@ func (bcsr BlobCreateSnapshotResponse) VersionID() string {
return bcsr.rawResponse.Header.Get("x-ms-version-id")
}
// BlobDeleteImmutabilityPolicyResponse ...
type BlobDeleteImmutabilityPolicyResponse struct {
rawResponse *http.Response
}
// Response returns the raw HTTP response object.
func (bdipr BlobDeleteImmutabilityPolicyResponse) Response() *http.Response {
return bdipr.rawResponse
}
// StatusCode returns the HTTP status code of the response, e.g. 200.
func (bdipr BlobDeleteImmutabilityPolicyResponse) StatusCode() int {
return bdipr.rawResponse.StatusCode
}
// Status returns the HTTP status message of the response, e.g. "200 OK".
func (bdipr BlobDeleteImmutabilityPolicyResponse) Status() string {
return bdipr.rawResponse.Status
}
// ClientRequestID returns the value for header x-ms-client-request-id.
func (bdipr BlobDeleteImmutabilityPolicyResponse) ClientRequestID() string {
return bdipr.rawResponse.Header.Get("x-ms-client-request-id")
}
// Date returns the value for header Date.
func (bdipr BlobDeleteImmutabilityPolicyResponse) Date() time.Time {
s := bdipr.rawResponse.Header.Get("Date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// ErrorCode returns the value for header x-ms-error-code.
func (bdipr BlobDeleteImmutabilityPolicyResponse) ErrorCode() string {
return bdipr.rawResponse.Header.Get("x-ms-error-code")
}
// RequestID returns the value for header x-ms-request-id.
func (bdipr BlobDeleteImmutabilityPolicyResponse) RequestID() string {
return bdipr.rawResponse.Header.Get("x-ms-request-id")
}
// Version returns the value for header x-ms-version.
func (bdipr BlobDeleteImmutabilityPolicyResponse) Version() string {
return bdipr.rawResponse.Header.Get("x-ms-version")
}
// BlobDeleteResponse ...
type BlobDeleteResponse struct {
rawResponse *http.Response
@ -2243,6 +2324,24 @@ func (bgpr BlobGetPropertiesResponse) ExpiresOn() time.Time {
return t
}
// ImmutabilityPolicyExpiresOn returns the value for header x-ms-immutability-policy-until-date.
func (bgpr BlobGetPropertiesResponse) ImmutabilityPolicyExpiresOn() time.Time {
s := bgpr.rawResponse.Header.Get("x-ms-immutability-policy-until-date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// ImmutabilityPolicyMode returns the value for header x-ms-immutability-policy-mode.
func (bgpr BlobGetPropertiesResponse) ImmutabilityPolicyMode() BlobImmutabilityPolicyModeType {
return BlobImmutabilityPolicyModeType(bgpr.rawResponse.Header.Get("x-ms-immutability-policy-mode"))
}
// IsCurrentVersion returns the value for header x-ms-is-current-version.
func (bgpr BlobGetPropertiesResponse) IsCurrentVersion() string {
return bgpr.rawResponse.Header.Get("x-ms-is-current-version")
@ -2304,6 +2403,11 @@ func (bgpr BlobGetPropertiesResponse) LeaseStatus() LeaseStatusType {
return LeaseStatusType(bgpr.rawResponse.Header.Get("x-ms-lease-status"))
}
// LegalHold returns the value for header x-ms-legal-hold.
func (bgpr BlobGetPropertiesResponse) LegalHold() string {
return bgpr.rawResponse.Header.Get("x-ms-legal-hold")
}
// ObjectReplicationPolicyID returns the value for header x-ms-or-policy-id.
func (bgpr BlobGetPropertiesResponse) ObjectReplicationPolicyID() string {
return bgpr.rawResponse.Header.Get("x-ms-or-policy-id")
@ -2358,25 +2462,16 @@ type BlobHierarchyListSegment struct {
// BlobItemInternal - An Azure Storage blob
type BlobItemInternal struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Blob"`
Name string `xml:"Name"`
Deleted bool `xml:"Deleted"`
Snapshot string `xml:"Snapshot"`
VersionID *string `xml:"VersionId"`
IsCurrentVersion *bool `xml:"IsCurrentVersion"`
Properties BlobProperties `xml:"Properties"`
Metadata Metadata `xml:"Metadata"`
BlobTags *BlobTags `xml:"Tags"`
ObjectReplicationMetadata map[string]string `xml:"ObjectReplicationMetadata"`
}
// BlobMetadata ...
type BlobMetadata struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Metadata"`
// AdditionalProperties - Unmatched properties from the message are deserialized this collection
AdditionalProperties map[string]string `xml:"AdditionalProperties"`
Encrypted *string `xml:"Encrypted,attr"`
XMLName xml.Name `xml:"Blob"`
Name string `xml:"Name"`
Deleted bool `xml:"Deleted"`
Snapshot string `xml:"Snapshot"`
VersionID *string `xml:"VersionId"`
IsCurrentVersion *bool `xml:"IsCurrentVersion"`
Properties BlobPropertiesInternal `xml:"Properties"`
Metadata Metadata `xml:"Metadata"`
BlobTags *BlobTags `xml:"Tags"`
ObjectReplicationMetadata map[string]string `xml:"ObjectReplicationMetadata"`
}
// BlobPrefix ...
@ -2384,8 +2479,8 @@ type BlobPrefix struct {
Name string `xml:"Name"`
}
// BlobProperties - Properties of a blob
type BlobProperties struct {
// BlobPropertiesInternal - Properties of a blob
type BlobPropertiesInternal struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Properties"`
CreationTime *time.Time `xml:"Creation-Time"`
@ -2433,19 +2528,23 @@ type BlobProperties struct {
ExpiresOn *time.Time `xml:"Expiry-Time"`
IsSealed *bool `xml:"Sealed"`
// RehydratePriority - Possible values include: 'RehydratePriorityHigh', 'RehydratePriorityStandard', 'RehydratePriorityNone'
RehydratePriority RehydratePriorityType `xml:"RehydratePriority"`
LastAccessedOn *time.Time `xml:"LastAccessTime"`
RehydratePriority RehydratePriorityType `xml:"RehydratePriority"`
LastAccessedOn *time.Time `xml:"LastAccessTime"`
ImmutabilityPolicyExpiresOn *time.Time `xml:"ImmutabilityPolicyUntilDate"`
// ImmutabilityPolicyMode - Possible values include: 'BlobImmutabilityPolicyModeMutable', 'BlobImmutabilityPolicyModeUnlocked', 'BlobImmutabilityPolicyModeLocked', 'BlobImmutabilityPolicyModeNone'
ImmutabilityPolicyMode BlobImmutabilityPolicyModeType `xml:"ImmutabilityPolicyMode"`
LegalHold *bool `xml:"LegalHold"`
}
// MarshalXML implements the xml.Marshaler interface for BlobPropertiesInternal.
func (bpi BlobProperties) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
bpi2 := (*blobProperties)(unsafe.Pointer(&bpi))
func (bpi BlobPropertiesInternal) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
bpi2 := (*blobPropertiesInternal)(unsafe.Pointer(&bpi))
return e.EncodeElement(*bpi2, start)
}
// UnmarshalXML implements the xml.Unmarshaler interface for BlobPropertiesInternal.
func (bpi *BlobProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
bpi2 := (*blobProperties)(unsafe.Pointer(bpi))
func (bpi *BlobPropertiesInternal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
bpi2 := (*blobPropertiesInternal)(unsafe.Pointer(bpi))
return d.DecodeElement(bpi2, &start)
}
@ -2896,6 +2995,135 @@ func (bshhr BlobSetHTTPHeadersResponse) Version() string {
return bshhr.rawResponse.Header.Get("x-ms-version")
}
// BlobSetImmutabilityPolicyResponse ...
type BlobSetImmutabilityPolicyResponse struct {
rawResponse *http.Response
}
// Response returns the raw HTTP response object.
func (bsipr BlobSetImmutabilityPolicyResponse) Response() *http.Response {
return bsipr.rawResponse
}
// StatusCode returns the HTTP status code of the response, e.g. 200.
func (bsipr BlobSetImmutabilityPolicyResponse) StatusCode() int {
return bsipr.rawResponse.StatusCode
}
// Status returns the HTTP status message of the response, e.g. "200 OK".
func (bsipr BlobSetImmutabilityPolicyResponse) Status() string {
return bsipr.rawResponse.Status
}
// ClientRequestID returns the value for header x-ms-client-request-id.
func (bsipr BlobSetImmutabilityPolicyResponse) ClientRequestID() string {
return bsipr.rawResponse.Header.Get("x-ms-client-request-id")
}
// Date returns the value for header Date.
func (bsipr BlobSetImmutabilityPolicyResponse) Date() time.Time {
s := bsipr.rawResponse.Header.Get("Date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// ErrorCode returns the value for header x-ms-error-code.
func (bsipr BlobSetImmutabilityPolicyResponse) ErrorCode() string {
return bsipr.rawResponse.Header.Get("x-ms-error-code")
}
// ImmutabilityPolicyExpiry returns the value for header x-ms-immutability-policy-until-date.
func (bsipr BlobSetImmutabilityPolicyResponse) ImmutabilityPolicyExpiry() time.Time {
s := bsipr.rawResponse.Header.Get("x-ms-immutability-policy-until-date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// ImmutabilityPolicyMode returns the value for header x-ms-immutability-policy-mode.
func (bsipr BlobSetImmutabilityPolicyResponse) ImmutabilityPolicyMode() BlobImmutabilityPolicyModeType {
return BlobImmutabilityPolicyModeType(bsipr.rawResponse.Header.Get("x-ms-immutability-policy-mode"))
}
// RequestID returns the value for header x-ms-request-id.
func (bsipr BlobSetImmutabilityPolicyResponse) RequestID() string {
return bsipr.rawResponse.Header.Get("x-ms-request-id")
}
// Version returns the value for header x-ms-version.
func (bsipr BlobSetImmutabilityPolicyResponse) Version() string {
return bsipr.rawResponse.Header.Get("x-ms-version")
}
// BlobSetLegalHoldResponse ...
type BlobSetLegalHoldResponse struct {
rawResponse *http.Response
}
// Response returns the raw HTTP response object.
func (bslhr BlobSetLegalHoldResponse) Response() *http.Response {
return bslhr.rawResponse
}
// StatusCode returns the HTTP status code of the response, e.g. 200.
func (bslhr BlobSetLegalHoldResponse) StatusCode() int {
return bslhr.rawResponse.StatusCode
}
// Status returns the HTTP status message of the response, e.g. "200 OK".
func (bslhr BlobSetLegalHoldResponse) Status() string {
return bslhr.rawResponse.Status
}
// ClientRequestID returns the value for header x-ms-client-request-id.
func (bslhr BlobSetLegalHoldResponse) ClientRequestID() string {
return bslhr.rawResponse.Header.Get("x-ms-client-request-id")
}
// Date returns the value for header Date.
func (bslhr BlobSetLegalHoldResponse) Date() time.Time {
s := bslhr.rawResponse.Header.Get("Date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// ErrorCode returns the value for header x-ms-error-code.
func (bslhr BlobSetLegalHoldResponse) ErrorCode() string {
return bslhr.rawResponse.Header.Get("x-ms-error-code")
}
// LegalHold returns the value for header x-ms-legal-hold.
func (bslhr BlobSetLegalHoldResponse) LegalHold() string {
return bslhr.rawResponse.Header.Get("x-ms-legal-hold")
}
// RequestID returns the value for header x-ms-request-id.
func (bslhr BlobSetLegalHoldResponse) RequestID() string {
return bslhr.rawResponse.Header.Get("x-ms-request-id")
}
// Version returns the value for header x-ms-version.
func (bslhr BlobSetLegalHoldResponse) Version() string {
return bslhr.rawResponse.Header.Get("x-ms-version")
}
// BlobSetMetadataResponse ...
type BlobSetMetadataResponse struct {
rawResponse *http.Response
@ -3288,7 +3516,7 @@ type Block struct {
// Name - The base64 encoded block ID.
Name string `xml:"Name"`
// Size - The block size in bytes.
Size int32 `xml:"Size"`
Size int64 `xml:"Size"`
}
// BlockBlobCommitBlockListResponse ...
@ -4419,6 +4647,11 @@ func (cgpr ContainerGetPropertiesResponse) HasLegalHold() string {
return cgpr.rawResponse.Header.Get("x-ms-has-legal-hold")
}
// IsImmutableStorageWithVersioningEnabled returns the value for header x-ms-immutable-storage-with-versioning-enabled.
func (cgpr ContainerGetPropertiesResponse) IsImmutableStorageWithVersioningEnabled() string {
return cgpr.rawResponse.Header.Get("x-ms-immutable-storage-with-versioning-enabled")
}
// LastModified returns the value for header Last-Modified.
func (cgpr ContainerGetPropertiesResponse) LastModified() time.Time {
s := cgpr.rawResponse.Header.Get("Last-Modified")
@ -4486,6 +4719,8 @@ type ContainerProperties struct {
PreventEncryptionScopeOverride *bool `xml:"DenyEncryptionScopeOverride"`
DeletedTime *time.Time `xml:"DeletedTime"`
RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"`
// IsImmutableStorageWithVersioningEnabled - Indicates if version level worm is enabled on this container.
IsImmutableStorageWithVersioningEnabled *bool `xml:"ImmutableStorageWithVersioningEnabled"`
}
// MarshalXML implements the xml.Marshaler interface for ContainerProperties.
@ -4928,18 +5163,19 @@ type DataLakeStorageErrorError struct {
Message *string `xml:"Message"`
}
// DelimitedTextConfiguration - delimited text configuration
// DelimitedTextConfiguration - Groups the settings used for interpreting the blob data if the blob is
// delimited text formatted.
type DelimitedTextConfiguration struct {
// ColumnSeparator - column separator
ColumnSeparator string `xml:"ColumnSeparator"`
// FieldQuote - field quote
FieldQuote string `xml:"FieldQuote"`
// RecordSeparator - record separator
RecordSeparator string `xml:"RecordSeparator"`
// EscapeChar - escape char
EscapeChar string `xml:"EscapeChar"`
// HeadersPresent - has headers
HeadersPresent bool `xml:"HasHeaders"`
// ColumnSeparator - The string used to separate columns.
ColumnSeparator *string `xml:"ColumnSeparator"`
// FieldQuote - The string used to quote a specific field.
FieldQuote *string `xml:"FieldQuote"`
// RecordSeparator - The string used to separate records.
RecordSeparator *string `xml:"RecordSeparator"`
// EscapeChar - The string used as an escape character.
EscapeChar *string `xml:"EscapeChar"`
// HeadersPresent - Represents whether the data has headers.
HeadersPresent *bool `xml:"HasHeaders"`
}
// DirectoryCreateResponse ...
@ -5542,6 +5778,24 @@ func (dr downloadResponse) ETag() ETag {
return ETag(dr.rawResponse.Header.Get("ETag"))
}
// ImmutabilityPolicyExpiresOn returns the value for header x-ms-immutability-policy-until-date.
func (dr downloadResponse) ImmutabilityPolicyExpiresOn() time.Time {
s := dr.rawResponse.Header.Get("x-ms-immutability-policy-until-date")
if s == "" {
return time.Time{}
}
t, err := time.Parse(time.RFC1123, s)
if err != nil {
t = time.Time{}
}
return t
}
// ImmutabilityPolicyMode returns the value for header x-ms-immutability-policy-mode.
func (dr downloadResponse) ImmutabilityPolicyMode() string {
return dr.rawResponse.Header.Get("x-ms-immutability-policy-mode")
}
// IsCurrentVersion returns the value for header x-ms-is-current-version.
func (dr downloadResponse) IsCurrentVersion() string {
return dr.rawResponse.Header.Get("x-ms-is-current-version")
@ -5598,6 +5852,11 @@ func (dr downloadResponse) LeaseStatus() LeaseStatusType {
return LeaseStatusType(dr.rawResponse.Header.Get("x-ms-lease-status"))
}
// LegalHold returns the value for header x-ms-legal-hold.
func (dr downloadResponse) LegalHold() string {
return dr.rawResponse.Header.Get("x-ms-legal-hold")
}
// ObjectReplicationPolicyID returns the value for header x-ms-or-policy-id.
func (dr downloadResponse) ObjectReplicationPolicyID() string {
return dr.rawResponse.Header.Get("x-ms-or-policy-id")
@ -5728,8 +5987,8 @@ func (gr *GeoReplication) UnmarshalXML(d *xml.Decoder, start xml.StartElement) e
type JSONTextConfiguration struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"JsonTextConfiguration"`
// RecordSeparator - record separator
RecordSeparator string `xml:"RecordSeparator"`
// RecordSeparator - The string used to separate records.
RecordSeparator *string `xml:"RecordSeparator"`
}
// KeyInfo - Key information
@ -6749,18 +7008,19 @@ type PageRange struct {
// QueryFormat ...
type QueryFormat struct {
// Type - Possible values include: 'QueryFormatDelimited', 'QueryFormatJSON', 'QueryFormatArrow', 'QueryFormatNone'
// Type - Possible values include: 'QueryFormatDelimited', 'QueryFormatJSON', 'QueryFormatArrow', 'QueryFormatParquet', 'QueryFormatNone'
Type QueryFormatType `xml:"Type"`
DelimitedTextConfiguration *DelimitedTextConfiguration `xml:"DelimitedTextConfiguration"`
JSONTextConfiguration *JSONTextConfiguration `xml:"JsonTextConfiguration"`
ArrowConfiguration *ArrowConfiguration `xml:"ArrowConfiguration"`
ParquetTextConfiguration map[string]interface{} `xml:"ParquetTextConfiguration"`
}
// QueryRequest - the quick query body
// QueryRequest - Groups the set of query request settings.
type QueryRequest struct {
// QueryType - the query type
// QueryType - Required. The type of the provided query expression.
QueryType string `xml:"QueryType"`
// Expression - a query statement
// Expression - The query expression in SQL. The maximum size of the query expression is 256KiB.
Expression string `xml:"Expression"`
InputSerialization *QuerySerialization `xml:"InputSerialization"`
OutputSerialization *QuerySerialization `xml:"OutputSerialization"`
@ -7260,7 +7520,7 @@ type StaticWebsite struct {
DefaultIndexDocumentPath *string `xml:"DefaultIndexDocumentPath"`
}
// StorageError ...
// // StorageError ...
// type StorageError struct {
// Message *string `xml:"Message"`
// }
@ -7499,7 +7759,7 @@ func init() {
if reflect.TypeOf((*AccessPolicy)(nil)).Elem().Size() != reflect.TypeOf((*accessPolicy)(nil)).Elem().Size() {
validateError(errors.New("size mismatch between AccessPolicy and accessPolicy"))
}
if reflect.TypeOf((*BlobProperties)(nil)).Elem().Size() != reflect.TypeOf((*blobProperties)(nil)).Elem().Size() {
if reflect.TypeOf((*BlobPropertiesInternal)(nil)).Elem().Size() != reflect.TypeOf((*blobPropertiesInternal)(nil)).Elem().Size() {
validateError(errors.New("size mismatch between BlobPropertiesInternal and blobPropertiesInternal"))
}
if reflect.TypeOf((*ContainerProperties)(nil)).Elem().Size() != reflect.TypeOf((*containerProperties)(nil)).Elem().Size() {
@ -7511,7 +7771,7 @@ func init() {
}
const (
rfc3339Format = "2006-01-02T15:04:05Z"
rfc3339Format = "2006-01-02T15:04:05.0000000Z07:00"
)
// used to convert times from UTC to GMT before sending across the wire
@ -7589,62 +7849,66 @@ type accessPolicy struct {
}
// internal type used for marshalling
type blobProperties struct {
type blobPropertiesInternal struct {
// XMLName is used for marshalling and is subject to removal in a future release.
XMLName xml.Name `xml:"Properties"`
CreationTime *timeRFC1123 `xml:"Creation-Time"`
LastModified timeRFC1123 `xml:"Last-Modified"`
Etag ETag `xml:"Etag"`
ContentLength *int64 `xml:"Content-Length"`
ContentType *string `xml:"Content-Type"`
ContentEncoding *string `xml:"Content-Encoding"`
ContentLanguage *string `xml:"Content-Language"`
ContentMD5 base64Encoded `xml:"Content-MD5"`
ContentDisposition *string `xml:"Content-Disposition"`
CacheControl *string `xml:"Cache-Control"`
BlobSequenceNumber *int64 `xml:"x-ms-blob-sequence-number"`
BlobType BlobType `xml:"BlobType"`
LeaseStatus LeaseStatusType `xml:"LeaseStatus"`
LeaseState LeaseStateType `xml:"LeaseState"`
LeaseDuration LeaseDurationType `xml:"LeaseDuration"`
CopyID *string `xml:"CopyId"`
CopyStatus CopyStatusType `xml:"CopyStatus"`
CopySource *string `xml:"CopySource"`
CopyProgress *string `xml:"CopyProgress"`
CopyCompletionTime *timeRFC1123 `xml:"CopyCompletionTime"`
CopyStatusDescription *string `xml:"CopyStatusDescription"`
ServerEncrypted *bool `xml:"ServerEncrypted"`
IncrementalCopy *bool `xml:"IncrementalCopy"`
DestinationSnapshot *string `xml:"DestinationSnapshot"`
DeletedTime *timeRFC1123 `xml:"DeletedTime"`
RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"`
AccessTier AccessTierType `xml:"AccessTier"`
AccessTierInferred *bool `xml:"AccessTierInferred"`
ArchiveStatus ArchiveStatusType `xml:"ArchiveStatus"`
CustomerProvidedKeySha256 *string `xml:"CustomerProvidedKeySha256"`
EncryptionScope *string `xml:"EncryptionScope"`
AccessTierChangeTime *timeRFC1123 `xml:"AccessTierChangeTime"`
TagCount *int32 `xml:"TagCount"`
ExpiresOn *timeRFC1123 `xml:"Expiry-Time"`
IsSealed *bool `xml:"Sealed"`
RehydratePriority RehydratePriorityType `xml:"RehydratePriority"`
LastAccessedOn *timeRFC1123 `xml:"LastAccessTime"`
XMLName xml.Name `xml:"Properties"`
CreationTime *timeRFC1123 `xml:"Creation-Time"`
LastModified timeRFC1123 `xml:"Last-Modified"`
Etag ETag `xml:"Etag"`
ContentLength *int64 `xml:"Content-Length"`
ContentType *string `xml:"Content-Type"`
ContentEncoding *string `xml:"Content-Encoding"`
ContentLanguage *string `xml:"Content-Language"`
ContentMD5 base64Encoded `xml:"Content-MD5"`
ContentDisposition *string `xml:"Content-Disposition"`
CacheControl *string `xml:"Cache-Control"`
BlobSequenceNumber *int64 `xml:"x-ms-blob-sequence-number"`
BlobType BlobType `xml:"BlobType"`
LeaseStatus LeaseStatusType `xml:"LeaseStatus"`
LeaseState LeaseStateType `xml:"LeaseState"`
LeaseDuration LeaseDurationType `xml:"LeaseDuration"`
CopyID *string `xml:"CopyId"`
CopyStatus CopyStatusType `xml:"CopyStatus"`
CopySource *string `xml:"CopySource"`
CopyProgress *string `xml:"CopyProgress"`
CopyCompletionTime *timeRFC1123 `xml:"CopyCompletionTime"`
CopyStatusDescription *string `xml:"CopyStatusDescription"`
ServerEncrypted *bool `xml:"ServerEncrypted"`
IncrementalCopy *bool `xml:"IncrementalCopy"`
DestinationSnapshot *string `xml:"DestinationSnapshot"`
DeletedTime *timeRFC1123 `xml:"DeletedTime"`
RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"`
AccessTier AccessTierType `xml:"AccessTier"`
AccessTierInferred *bool `xml:"AccessTierInferred"`
ArchiveStatus ArchiveStatusType `xml:"ArchiveStatus"`
CustomerProvidedKeySha256 *string `xml:"CustomerProvidedKeySha256"`
EncryptionScope *string `xml:"EncryptionScope"`
AccessTierChangeTime *timeRFC1123 `xml:"AccessTierChangeTime"`
TagCount *int32 `xml:"TagCount"`
ExpiresOn *timeRFC1123 `xml:"Expiry-Time"`
IsSealed *bool `xml:"Sealed"`
RehydratePriority RehydratePriorityType `xml:"RehydratePriority"`
LastAccessedOn *timeRFC1123 `xml:"LastAccessTime"`
ImmutabilityPolicyExpiresOn *timeRFC1123 `xml:"ImmutabilityPolicyUntilDate"`
ImmutabilityPolicyMode BlobImmutabilityPolicyModeType `xml:"ImmutabilityPolicyMode"`
LegalHold *bool `xml:"LegalHold"`
}
// internal type used for marshalling
type containerProperties struct {
LastModified timeRFC1123 `xml:"Last-Modified"`
Etag ETag `xml:"Etag"`
LeaseStatus LeaseStatusType `xml:"LeaseStatus"`
LeaseState LeaseStateType `xml:"LeaseState"`
LeaseDuration LeaseDurationType `xml:"LeaseDuration"`
PublicAccess PublicAccessType `xml:"PublicAccess"`
HasImmutabilityPolicy *bool `xml:"HasImmutabilityPolicy"`
HasLegalHold *bool `xml:"HasLegalHold"`
DefaultEncryptionScope *string `xml:"DefaultEncryptionScope"`
PreventEncryptionScopeOverride *bool `xml:"DenyEncryptionScopeOverride"`
DeletedTime *timeRFC1123 `xml:"DeletedTime"`
RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"`
LastModified timeRFC1123 `xml:"Last-Modified"`
Etag ETag `xml:"Etag"`
LeaseStatus LeaseStatusType `xml:"LeaseStatus"`
LeaseState LeaseStateType `xml:"LeaseState"`
LeaseDuration LeaseDurationType `xml:"LeaseDuration"`
PublicAccess PublicAccessType `xml:"PublicAccess"`
HasImmutabilityPolicy *bool `xml:"HasImmutabilityPolicy"`
HasLegalHold *bool `xml:"HasLegalHold"`
DefaultEncryptionScope *string `xml:"DefaultEncryptionScope"`
PreventEncryptionScopeOverride *bool `xml:"DenyEncryptionScopeOverride"`
DeletedTime *timeRFC1123 `xml:"DeletedTime"`
RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"`
IsImmutableStorageWithVersioningEnabled *bool `xml:"ImmutableStorageWithVersioningEnabled"`
}
// internal type used for marshalling

Просмотреть файл

@ -261,14 +261,17 @@ func (client pageBlobClient) copyIncrementalResponder(resp pipeline.Response) (p
// use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. requestID is provides a
// client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage
// analytics logging is enabled. blobTagsString is optional. Used to set blob tags in various blob operations.
func (client pageBlobClient) Create(ctx context.Context, contentLength int64, blobContentLength int64, timeout *int32, tier PremiumPageBlobAccessTierType, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, blobSequenceNumber *int64, requestID *string, blobTagsString *string) (*PageBlobCreateResponse, error) {
// immutabilityPolicyExpiry is specifies the date time when the blobs immutability policy is set to expire.
// immutabilityPolicyMode is specifies the immutability policy mode to set on the blob. legalHold is specified if a
// legal hold should be set on the blob.
func (client pageBlobClient) Create(ctx context.Context, contentLength int64, blobContentLength int64, timeout *int32, tier PremiumPageBlobAccessTierType, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, blobSequenceNumber *int64, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (*PageBlobCreateResponse, error) {
if err := validate([]validation{
{targetValue: timeout,
constraints: []constraint{{target: "timeout", name: null, rule: false,
chain: []constraint{{target: "timeout", name: inclusiveMinimum, rule: 0, chain: nil}}}}}}); err != nil {
return nil, err
}
req, err := client.createPreparer(contentLength, blobContentLength, timeout, tier, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestID, blobTagsString)
req, err := client.createPreparer(contentLength, blobContentLength, timeout, tier, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseID, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestID, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold)
if err != nil {
return nil, err
}
@ -280,7 +283,7 @@ func (client pageBlobClient) Create(ctx context.Context, contentLength int64, bl
}
// createPreparer prepares the Create request.
func (client pageBlobClient) createPreparer(contentLength int64, blobContentLength int64, timeout *int32, tier PremiumPageBlobAccessTierType, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, blobSequenceNumber *int64, requestID *string, blobTagsString *string) (pipeline.Request, error) {
func (client pageBlobClient) createPreparer(contentLength int64, blobContentLength int64, timeout *int32, tier PremiumPageBlobAccessTierType, blobContentType *string, blobContentEncoding *string, blobContentLanguage *string, blobContentMD5 []byte, blobCacheControl *string, metadata map[string]string, leaseID *string, blobContentDisposition *string, encryptionKey *string, encryptionKeySha256 *string, encryptionAlgorithm EncryptionAlgorithmType, encryptionScope *string, ifModifiedSince *time.Time, ifUnmodifiedSince *time.Time, ifMatch *ETag, ifNoneMatch *ETag, ifTags *string, blobSequenceNumber *int64, requestID *string, blobTagsString *string, immutabilityPolicyExpiry *time.Time, immutabilityPolicyMode BlobImmutabilityPolicyModeType, legalHold *bool) (pipeline.Request, error) {
req, err := pipeline.NewRequest("PUT", client.url, nil)
if err != nil {
return req, pipeline.NewError(err, "failed to create request")
@ -358,6 +361,15 @@ func (client pageBlobClient) createPreparer(contentLength int64, blobContentLeng
if blobTagsString != nil {
req.Header.Set("x-ms-tags", *blobTagsString)
}
if immutabilityPolicyExpiry != nil {
req.Header.Set("x-ms-immutability-policy-until-date", (*immutabilityPolicyExpiry).In(gmt).Format(time.RFC1123))
}
if immutabilityPolicyMode != BlobImmutabilityPolicyModeNone {
req.Header.Set("x-ms-immutability-policy-mode", string(immutabilityPolicyMode))
}
if legalHold != nil {
req.Header.Set("x-ms-legal-hold", strconv.FormatBool(*legalHold))
}
req.Header.Set("x-ms-blob-type", "PageBlob")
return req, nil
}

Просмотреть файл

@ -5,7 +5,7 @@ package azblob
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return "Azure-SDK-For-Go/0.0.0 azblob/2020-04-08"
return "Azure-SDK-For-Go/0.0.0 azblob/2020-08-04"
}
// Version returns the semantic version (see http://semver.org) of the client.

Просмотреть файл

@ -11,7 +11,7 @@ gofmt -w Go_BlobStorage/*
### Settings
``` yaml
input-file: ./blob.json
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.BlobStorage/preview/2020-08-04/blob.json
go: true
output-folder: Go_BlobStorage
namespace: azblob
@ -20,5 +20,37 @@ enable-xml: true
file-prefix: zz_generated_
```
### Set blob metadata to the right type
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$["BlobMetadata"] = {
"type": "object",
"xml": {
"name": "Metadata"
},
"additionalProperties": {
"type": "string"
}
}
```
### Generate immutability policy correctly
```yaml
directive:
- from: swagger-document
where: $.parameters.ImmutabilityPolicyMode
transform: >
$.enum = [
"Mutable",
"Unlocked",
"Locked"
]
```
### TODO: Get rid of StorageError since we define it
### TODO: rfc3339Format = "2006-01-02T15:04:05Z" //This was wrong in the generated code

Разница между файлами не показана из-за своего большого размера Загрузить разницу