...

Source file src/github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake/path.go

Documentation: github.com/Azure/azure-sdk-for-go/services/storage/datalake/2018-11-09/storagedatalake

     1  package storagedatalake
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"context"
    11  	"github.com/Azure/go-autorest/autorest"
    12  	"github.com/Azure/go-autorest/autorest/azure"
    13  	"github.com/Azure/go-autorest/autorest/validation"
    14  	"github.com/Azure/go-autorest/tracing"
    15  	"io"
    16  	"net/http"
    17  )
    18  
    19  // PathClient is the azure Data Lake Storage provides storage for Hadoop and other big data workloads.
    20  type PathClient struct {
    21  	BaseClient
    22  }
    23  
    24  // NewPathClient creates an instance of the PathClient client.
    25  func NewPathClient(xMsVersion string, accountName string) PathClient {
    26  	return PathClient{New(xMsVersion, accountName)}
    27  }
    28  
    29  // Create create or rename a file or directory.    By default, the destination is overwritten and if the destination
    30  // already exists and has a lease the lease is broken.  This operation supports conditional HTTP requests.  For more
    31  // information, see [Specifying Conditional Headers for Blob Service
    32  // Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
    33  // To fail if the destination already exists, use a conditional request with If-None-Match: "*".
    34  // Parameters:
    35  // filesystem - the filesystem identifier.
    36  // pathParameter - the file or directory path.
    37  // resource - required only for Create File and Create Directory. The value must be "file" or "directory".
    38  // continuation - optional.  When renaming a directory, the number of paths that are renamed with each
    39  // invocation is limited.  If the number of paths to be renamed exceeds this limit, a continuation token is
    40  // returned in this response header.  When a continuation token is returned in the response, it must be
    41  // specified in a subsequent invocation of the rename operation to continue renaming the directory.
    42  // mode - optional. Valid only when namespace is enabled. This parameter determines the behavior of the rename
    43  // operation. The value must be "legacy" or "posix", and the default value will be "posix".
    44  // cacheControl - optional.  The service stores this value and includes it in the "Cache-Control" response
    45  // header for "Read File" operations for "Read File" operations.
    46  // contentEncoding - optional.  Specifies which content encodings have been applied to the file. This value is
    47  // returned to the client when the "Read File" operation is performed.
    48  // contentLanguage - optional.  Specifies the natural language used by the intended audience for the file.
    49  // contentDisposition - optional.  The service stores this value and includes it in the "Content-Disposition"
    50  // response header for "Read File" operations.
    51  // xMsCacheControl - optional.  The service stores this value and includes it in the "Cache-Control" response
    52  // header for "Read File" operations.
    53  // xMsContentType - optional.  The service stores this value and includes it in the "Content-Type" response
    54  // header for "Read File" operations.
    55  // xMsContentEncoding - optional.  The service stores this value and includes it in the "Content-Encoding"
    56  // response header for "Read File" operations.
    57  // xMsContentLanguage - optional.  The service stores this value and includes it in the "Content-Language"
    58  // response header for "Read File" operations.
    59  // xMsContentDisposition - optional.  The service stores this value and includes it in the
    60  // "Content-Disposition" response header for "Read File" operations.
    61  // xMsRenameSource - an optional file or directory to be renamed.  The value must have the following format:
    62  // "/{filesystem}/{path}".  If "x-ms-properties" is specified, the properties will overwrite the existing
    63  // properties; otherwise, the existing properties will be preserved. This value must be a URL percent-encoded
    64  // string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set.
    65  // xMsLeaseID - optional.  A lease ID for the path specified in the URI.  The path to be overwritten must have
    66  // an active lease and the lease ID must match.
    67  // xMsSourceLeaseID - optional for rename operations.  A lease ID for the source path.  The source path must
    68  // have an active lease and the lease ID must match.
    69  // xMsProperties - optional.  User-defined properties to be stored with the file or directory, in the format of
    70  // a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded
    71  // string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set.
    72  // xMsPermissions - optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX
    73  // access permissions for the file owner, the file owning group, and others. Each class may be granted read,
    74  // write, or execute permission.  The sticky bit is also supported.  Both symbolic (rwxrw-rw-) and 4-digit
    75  // octal notation (e.g. 0766) are supported.
    76  // xMsUmask - optional and only valid if Hierarchical Namespace is enabled for the account. When creating a
    77  // file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of
    78  // the file or directory to be created.  The resulting permission is given by p & ^u, where p is the permission
    79  // and u is the umask.  For example, if p is 0777 and u is 0057, then the resulting permission is 0720.  The
    80  // default permission is 0777 for a directory and 0666 for a file.  The default umask is 0027.  The umask must
    81  // be specified in 4-digit octal notation (e.g. 0766).
    82  // ifMatch - optional.  An ETag value. Specify this header to perform the operation only if the resource's ETag
    83  // matches the value specified. The ETag must be specified in quotes.
    84  // ifNoneMatch - optional.  An ETag value or the special wildcard ("*") value. Specify this header to perform
    85  // the operation only if the resource's ETag does not match the value specified. The ETag must be specified in
    86  // quotes.
    87  // ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the
    88  // resource has been modified since the specified date and time.
    89  // ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if
    90  // the resource has not been modified since the specified date and time.
    91  // xMsSourceIfMatch - optional.  An ETag value. Specify this header to perform the rename operation only if the
    92  // source's ETag matches the value specified. The ETag must be specified in quotes.
    93  // xMsSourceIfNoneMatch - optional.  An ETag value or the special wildcard ("*") value. Specify this header to
    94  // perform the rename operation only if the source's ETag does not match the value specified. The ETag must be
    95  // specified in quotes.
    96  // xMsSourceIfModifiedSince - optional. A date and time value. Specify this header to perform the rename
    97  // operation only if the source has been modified since the specified date and time.
    98  // xMsSourceIfUnmodifiedSince - optional. A date and time value. Specify this header to perform the rename
    99  // operation only if the source has not been modified since the specified date and time.
   100  // xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation.
   101  // timeout - an optional operation timeout value in seconds. The period begins when the request is received by
   102  // the service. If the timeout value elapses before the operation completes, the operation fails.
   103  // xMsDate - specifies the Coordinated Universal Time (UTC) for the request.  This is required when using
   104  // shared key authorization.
   105  func (client PathClient) Create(ctx context.Context, filesystem string, pathParameter string, resource PathResourceType, continuation string, mode PathRenameMode, cacheControl string, contentEncoding string, contentLanguage string, contentDisposition string, xMsCacheControl string, xMsContentType string, xMsContentEncoding string, xMsContentLanguage string, xMsContentDisposition string, xMsRenameSource string, xMsLeaseID string, xMsSourceLeaseID string, xMsProperties string, xMsPermissions string, xMsUmask string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsSourceIfMatch string, xMsSourceIfNoneMatch string, xMsSourceIfModifiedSince string, xMsSourceIfUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) {
   106  	if tracing.IsEnabled() {
   107  		ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.Create")
   108  		defer func() {
   109  			sc := -1
   110  			if result.Response != nil {
   111  				sc = result.Response.StatusCode
   112  			}
   113  			tracing.EndSpan(ctx, sc, err)
   114  		}()
   115  	}
   116  	if err := validation.Validate([]validation.Validation{
   117  		{TargetValue: xMsLeaseID,
   118  			Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false,
   119  				Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   120  		{TargetValue: xMsSourceLeaseID,
   121  			Constraints: []validation.Constraint{{Target: "xMsSourceLeaseID", Name: validation.Empty, Rule: false,
   122  				Chain: []validation.Constraint{{Target: "xMsSourceLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   123  		{TargetValue: filesystem,
   124  			Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil},
   125  				{Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}},
   126  		{TargetValue: xMsClientRequestID,
   127  			Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false,
   128  				Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   129  		{TargetValue: timeout,
   130  			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
   131  				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil {
   132  		return result, validation.NewError("storagedatalake.PathClient", "Create", err.Error())
   133  	}
   134  
   135  	req, err := client.CreatePreparer(ctx, filesystem, pathParameter, resource, continuation, mode, cacheControl, contentEncoding, contentLanguage, contentDisposition, xMsCacheControl, xMsContentType, xMsContentEncoding, xMsContentLanguage, xMsContentDisposition, xMsRenameSource, xMsLeaseID, xMsSourceLeaseID, xMsProperties, xMsPermissions, xMsUmask, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsSourceIfMatch, xMsSourceIfNoneMatch, xMsSourceIfModifiedSince, xMsSourceIfUnmodifiedSince, xMsClientRequestID, timeout, xMsDate)
   136  	if err != nil {
   137  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", nil, "Failure preparing request")
   138  		return
   139  	}
   140  
   141  	resp, err := client.CreateSender(req)
   142  	if err != nil {
   143  		result.Response = resp
   144  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", resp, "Failure sending request")
   145  		return
   146  	}
   147  
   148  	result, err = client.CreateResponder(resp)
   149  	if err != nil {
   150  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Create", resp, "Failure responding to request")
   151  		return
   152  	}
   153  
   154  	return
   155  }
   156  
   157  // CreatePreparer prepares the Create request.
   158  func (client PathClient) CreatePreparer(ctx context.Context, filesystem string, pathParameter string, resource PathResourceType, continuation string, mode PathRenameMode, cacheControl string, contentEncoding string, contentLanguage string, contentDisposition string, xMsCacheControl string, xMsContentType string, xMsContentEncoding string, xMsContentLanguage string, xMsContentDisposition string, xMsRenameSource string, xMsLeaseID string, xMsSourceLeaseID string, xMsProperties string, xMsPermissions string, xMsUmask string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsSourceIfMatch string, xMsSourceIfNoneMatch string, xMsSourceIfModifiedSince string, xMsSourceIfUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) {
   159  	urlParameters := map[string]interface{}{
   160  		"accountName": client.AccountName,
   161  		"dnsSuffix":   client.DNSSuffix,
   162  	}
   163  
   164  	pathParameters := map[string]interface{}{
   165  		"filesystem": autorest.Encode("path", filesystem),
   166  		"path":       autorest.Encode("path", pathParameter),
   167  	}
   168  
   169  	queryParameters := map[string]interface{}{}
   170  	if len(string(resource)) > 0 {
   171  		queryParameters["resource"] = autorest.Encode("query", resource)
   172  	}
   173  	if len(continuation) > 0 {
   174  		queryParameters["continuation"] = autorest.Encode("query", continuation)
   175  	}
   176  	if len(string(mode)) > 0 {
   177  		queryParameters["mode"] = autorest.Encode("query", mode)
   178  	}
   179  	if timeout != nil {
   180  		queryParameters["timeout"] = autorest.Encode("query", *timeout)
   181  	}
   182  
   183  	preparer := autorest.CreatePreparer(
   184  		autorest.AsPut(),
   185  		autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters),
   186  		autorest.WithPathParameters("/{filesystem}/{path}", pathParameters),
   187  		autorest.WithQueryParameters(queryParameters))
   188  	if len(cacheControl) > 0 {
   189  		preparer = autorest.DecoratePreparer(preparer,
   190  			autorest.WithHeader("Cache-Control", autorest.String(cacheControl)))
   191  	}
   192  	if len(contentEncoding) > 0 {
   193  		preparer = autorest.DecoratePreparer(preparer,
   194  			autorest.WithHeader("Content-Encoding", autorest.String(contentEncoding)))
   195  	}
   196  	if len(contentLanguage) > 0 {
   197  		preparer = autorest.DecoratePreparer(preparer,
   198  			autorest.WithHeader("Content-Language", autorest.String(contentLanguage)))
   199  	}
   200  	if len(contentDisposition) > 0 {
   201  		preparer = autorest.DecoratePreparer(preparer,
   202  			autorest.WithHeader("Content-Disposition", autorest.String(contentDisposition)))
   203  	}
   204  	if len(xMsCacheControl) > 0 {
   205  		preparer = autorest.DecoratePreparer(preparer,
   206  			autorest.WithHeader("x-ms-cache-control", autorest.String(xMsCacheControl)))
   207  	}
   208  	if len(xMsContentType) > 0 {
   209  		preparer = autorest.DecoratePreparer(preparer,
   210  			autorest.WithHeader("x-ms-content-type", autorest.String(xMsContentType)))
   211  	}
   212  	if len(xMsContentEncoding) > 0 {
   213  		preparer = autorest.DecoratePreparer(preparer,
   214  			autorest.WithHeader("x-ms-content-encoding", autorest.String(xMsContentEncoding)))
   215  	}
   216  	if len(xMsContentLanguage) > 0 {
   217  		preparer = autorest.DecoratePreparer(preparer,
   218  			autorest.WithHeader("x-ms-content-language", autorest.String(xMsContentLanguage)))
   219  	}
   220  	if len(xMsContentDisposition) > 0 {
   221  		preparer = autorest.DecoratePreparer(preparer,
   222  			autorest.WithHeader("x-ms-content-disposition", autorest.String(xMsContentDisposition)))
   223  	}
   224  	if len(xMsRenameSource) > 0 {
   225  		preparer = autorest.DecoratePreparer(preparer,
   226  			autorest.WithHeader("x-ms-rename-source", autorest.String(xMsRenameSource)))
   227  	}
   228  	if len(xMsLeaseID) > 0 {
   229  		preparer = autorest.DecoratePreparer(preparer,
   230  			autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID)))
   231  	}
   232  	if len(xMsSourceLeaseID) > 0 {
   233  		preparer = autorest.DecoratePreparer(preparer,
   234  			autorest.WithHeader("x-ms-source-lease-id", autorest.String(xMsSourceLeaseID)))
   235  	}
   236  	if len(xMsProperties) > 0 {
   237  		preparer = autorest.DecoratePreparer(preparer,
   238  			autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties)))
   239  	}
   240  	if len(xMsPermissions) > 0 {
   241  		preparer = autorest.DecoratePreparer(preparer,
   242  			autorest.WithHeader("x-ms-permissions", autorest.String(xMsPermissions)))
   243  	}
   244  	if len(xMsUmask) > 0 {
   245  		preparer = autorest.DecoratePreparer(preparer,
   246  			autorest.WithHeader("x-ms-umask", autorest.String(xMsUmask)))
   247  	}
   248  	if len(ifMatch) > 0 {
   249  		preparer = autorest.DecoratePreparer(preparer,
   250  			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
   251  	}
   252  	if len(ifNoneMatch) > 0 {
   253  		preparer = autorest.DecoratePreparer(preparer,
   254  			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
   255  	}
   256  	if len(ifModifiedSince) > 0 {
   257  		preparer = autorest.DecoratePreparer(preparer,
   258  			autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
   259  	}
   260  	if len(ifUnmodifiedSince) > 0 {
   261  		preparer = autorest.DecoratePreparer(preparer,
   262  			autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
   263  	}
   264  	if len(xMsSourceIfMatch) > 0 {
   265  		preparer = autorest.DecoratePreparer(preparer,
   266  			autorest.WithHeader("x-ms-source-if-match", autorest.String(xMsSourceIfMatch)))
   267  	}
   268  	if len(xMsSourceIfNoneMatch) > 0 {
   269  		preparer = autorest.DecoratePreparer(preparer,
   270  			autorest.WithHeader("x-ms-source-if-none-match", autorest.String(xMsSourceIfNoneMatch)))
   271  	}
   272  	if len(xMsSourceIfModifiedSince) > 0 {
   273  		preparer = autorest.DecoratePreparer(preparer,
   274  			autorest.WithHeader("x-ms-source-if-modified-since", autorest.String(xMsSourceIfModifiedSince)))
   275  	}
   276  	if len(xMsSourceIfUnmodifiedSince) > 0 {
   277  		preparer = autorest.DecoratePreparer(preparer,
   278  			autorest.WithHeader("x-ms-source-if-unmodified-since", autorest.String(xMsSourceIfUnmodifiedSince)))
   279  	}
   280  	if len(xMsClientRequestID) > 0 {
   281  		preparer = autorest.DecoratePreparer(preparer,
   282  			autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID)))
   283  	}
   284  	if len(xMsDate) > 0 {
   285  		preparer = autorest.DecoratePreparer(preparer,
   286  			autorest.WithHeader("x-ms-date", autorest.String(xMsDate)))
   287  	}
   288  	if len(client.XMsVersion) > 0 {
   289  		preparer = autorest.DecoratePreparer(preparer,
   290  			autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion)))
   291  	}
   292  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   293  }
   294  
   295  // CreateSender sends the Create request. The method will close the
   296  // http.Response Body if it receives an error.
   297  func (client PathClient) CreateSender(req *http.Request) (*http.Response, error) {
   298  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   299  }
   300  
   301  // CreateResponder handles the response to the Create request. The method always
   302  // closes the http.Response Body.
   303  func (client PathClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
   304  	err = autorest.Respond(
   305  		resp,
   306  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
   307  		autorest.ByClosing())
   308  	result.Response = resp
   309  	return
   310  }
   311  
   312  // Delete delete the file or directory. This operation supports conditional HTTP requests.  For more information, see
   313  // [Specifying Conditional Headers for Blob Service
   314  // Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
   315  // Parameters:
   316  // filesystem - the filesystem identifier.
   317  // pathParameter - the file or directory path.
   318  // recursive - required and valid only when the resource is a directory.  If "true", all paths beneath the
   319  // directory will be deleted. If "false" and the directory is non-empty, an error occurs.
   320  // continuation - optional.  When deleting a directory, the number of paths that are deleted with each
   321  // invocation is limited.  If the number of paths to be deleted exceeds this limit, a continuation token is
   322  // returned in this response header.  When a continuation token is returned in the response, it must be
   323  // specified in a subsequent invocation of the delete operation to continue deleting the directory.
   324  // xMsLeaseID - the lease ID must be specified if there is an active lease.
   325  // ifMatch - optional.  An ETag value. Specify this header to perform the operation only if the resource's ETag
   326  // matches the value specified. The ETag must be specified in quotes.
   327  // ifNoneMatch - optional.  An ETag value or the special wildcard ("*") value. Specify this header to perform
   328  // the operation only if the resource's ETag does not match the value specified. The ETag must be specified in
   329  // quotes.
   330  // ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the
   331  // resource has been modified since the specified date and time.
   332  // ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if
   333  // the resource has not been modified since the specified date and time.
   334  // xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation.
   335  // timeout - an optional operation timeout value in seconds. The period begins when the request is received by
   336  // the service. If the timeout value elapses before the operation completes, the operation fails.
   337  // xMsDate - specifies the Coordinated Universal Time (UTC) for the request.  This is required when using
   338  // shared key authorization.
   339  func (client PathClient) Delete(ctx context.Context, filesystem string, pathParameter string, recursive *bool, continuation string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) {
   340  	if tracing.IsEnabled() {
   341  		ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.Delete")
   342  		defer func() {
   343  			sc := -1
   344  			if result.Response != nil {
   345  				sc = result.Response.StatusCode
   346  			}
   347  			tracing.EndSpan(ctx, sc, err)
   348  		}()
   349  	}
   350  	if err := validation.Validate([]validation.Validation{
   351  		{TargetValue: xMsLeaseID,
   352  			Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false,
   353  				Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   354  		{TargetValue: filesystem,
   355  			Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil},
   356  				{Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}},
   357  		{TargetValue: xMsClientRequestID,
   358  			Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false,
   359  				Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   360  		{TargetValue: timeout,
   361  			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
   362  				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil {
   363  		return result, validation.NewError("storagedatalake.PathClient", "Delete", err.Error())
   364  	}
   365  
   366  	req, err := client.DeletePreparer(ctx, filesystem, pathParameter, recursive, continuation, xMsLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate)
   367  	if err != nil {
   368  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", nil, "Failure preparing request")
   369  		return
   370  	}
   371  
   372  	resp, err := client.DeleteSender(req)
   373  	if err != nil {
   374  		result.Response = resp
   375  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", resp, "Failure sending request")
   376  		return
   377  	}
   378  
   379  	result, err = client.DeleteResponder(resp)
   380  	if err != nil {
   381  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Delete", resp, "Failure responding to request")
   382  		return
   383  	}
   384  
   385  	return
   386  }
   387  
   388  // DeletePreparer prepares the Delete request.
   389  func (client PathClient) DeletePreparer(ctx context.Context, filesystem string, pathParameter string, recursive *bool, continuation string, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) {
   390  	urlParameters := map[string]interface{}{
   391  		"accountName": client.AccountName,
   392  		"dnsSuffix":   client.DNSSuffix,
   393  	}
   394  
   395  	pathParameters := map[string]interface{}{
   396  		"filesystem": autorest.Encode("path", filesystem),
   397  		"path":       autorest.Encode("path", pathParameter),
   398  	}
   399  
   400  	queryParameters := map[string]interface{}{}
   401  	if recursive != nil {
   402  		queryParameters["recursive"] = autorest.Encode("query", *recursive)
   403  	}
   404  	if len(continuation) > 0 {
   405  		queryParameters["continuation"] = autorest.Encode("query", continuation)
   406  	}
   407  	if timeout != nil {
   408  		queryParameters["timeout"] = autorest.Encode("query", *timeout)
   409  	}
   410  
   411  	preparer := autorest.CreatePreparer(
   412  		autorest.AsDelete(),
   413  		autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters),
   414  		autorest.WithPathParameters("/{filesystem}/{path}", pathParameters),
   415  		autorest.WithQueryParameters(queryParameters))
   416  	if len(xMsLeaseID) > 0 {
   417  		preparer = autorest.DecoratePreparer(preparer,
   418  			autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID)))
   419  	}
   420  	if len(ifMatch) > 0 {
   421  		preparer = autorest.DecoratePreparer(preparer,
   422  			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
   423  	}
   424  	if len(ifNoneMatch) > 0 {
   425  		preparer = autorest.DecoratePreparer(preparer,
   426  			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
   427  	}
   428  	if len(ifModifiedSince) > 0 {
   429  		preparer = autorest.DecoratePreparer(preparer,
   430  			autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
   431  	}
   432  	if len(ifUnmodifiedSince) > 0 {
   433  		preparer = autorest.DecoratePreparer(preparer,
   434  			autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
   435  	}
   436  	if len(xMsClientRequestID) > 0 {
   437  		preparer = autorest.DecoratePreparer(preparer,
   438  			autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID)))
   439  	}
   440  	if len(xMsDate) > 0 {
   441  		preparer = autorest.DecoratePreparer(preparer,
   442  			autorest.WithHeader("x-ms-date", autorest.String(xMsDate)))
   443  	}
   444  	if len(client.XMsVersion) > 0 {
   445  		preparer = autorest.DecoratePreparer(preparer,
   446  			autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion)))
   447  	}
   448  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   449  }
   450  
   451  // DeleteSender sends the Delete request. The method will close the
   452  // http.Response Body if it receives an error.
   453  func (client PathClient) DeleteSender(req *http.Request) (*http.Response, error) {
   454  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   455  }
   456  
   457  // DeleteResponder handles the response to the Delete request. The method always
   458  // closes the http.Response Body.
   459  func (client PathClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
   460  	err = autorest.Respond(
   461  		resp,
   462  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   463  		autorest.ByClosing())
   464  	result.Response = resp
   465  	return
   466  }
   467  
   468  // GetProperties get Properties returns all system and user defined properties for a path. Get Status returns all
   469  // system defined properties for a path. Get Access Control List returns the access control list for a path. This
   470  // operation supports conditional HTTP requests.  For more information, see [Specifying Conditional Headers for Blob
   471  // Service
   472  // Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
   473  // Parameters:
   474  // filesystem - the filesystem identifier.
   475  // pathParameter - the file or directory path.
   476  // action - optional. If the value is "getStatus" only the system defined properties for the path are returned.
   477  // If the value is "getAccessControl" the access control list is returned in the response headers (Hierarchical
   478  // Namespace must be enabled for the account), otherwise the properties are returned.
   479  // upn - optional. Valid only when Hierarchical Namespace is enabled for the account. If "true", the user
   480  // identity values returned in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be transformed
   481  // from Azure Active Directory Object IDs to User Principal Names.  If "false", the values will be returned as
   482  // Azure Active Directory Object IDs. The default value is false. Note that group and application Object IDs
   483  // are not translated because they do not have unique friendly names.
   484  // xMsLeaseID - optional. If this header is specified, the operation will be performed only if both of the
   485  // following conditions are met: i) the path's lease is currently active and ii) the lease ID specified in the
   486  // request matches that of the path.
   487  // ifMatch - optional.  An ETag value. Specify this header to perform the operation only if the resource's ETag
   488  // matches the value specified. The ETag must be specified in quotes.
   489  // ifNoneMatch - optional.  An ETag value or the special wildcard ("*") value. Specify this header to perform
   490  // the operation only if the resource's ETag does not match the value specified. The ETag must be specified in
   491  // quotes.
   492  // ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the
   493  // resource has been modified since the specified date and time.
   494  // ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if
   495  // the resource has not been modified since the specified date and time.
   496  // xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation.
   497  // timeout - an optional operation timeout value in seconds. The period begins when the request is received by
   498  // the service. If the timeout value elapses before the operation completes, the operation fails.
   499  // xMsDate - specifies the Coordinated Universal Time (UTC) for the request.  This is required when using
   500  // shared key authorization.
   501  func (client PathClient) GetProperties(ctx context.Context, filesystem string, pathParameter string, action PathGetPropertiesAction, upn *bool, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) {
   502  	if tracing.IsEnabled() {
   503  		ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.GetProperties")
   504  		defer func() {
   505  			sc := -1
   506  			if result.Response != nil {
   507  				sc = result.Response.StatusCode
   508  			}
   509  			tracing.EndSpan(ctx, sc, err)
   510  		}()
   511  	}
   512  	if err := validation.Validate([]validation.Validation{
   513  		{TargetValue: xMsLeaseID,
   514  			Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false,
   515  				Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   516  		{TargetValue: filesystem,
   517  			Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil},
   518  				{Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}},
   519  		{TargetValue: xMsClientRequestID,
   520  			Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false,
   521  				Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   522  		{TargetValue: timeout,
   523  			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
   524  				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil {
   525  		return result, validation.NewError("storagedatalake.PathClient", "GetProperties", err.Error())
   526  	}
   527  
   528  	req, err := client.GetPropertiesPreparer(ctx, filesystem, pathParameter, action, upn, xMsLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate)
   529  	if err != nil {
   530  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", nil, "Failure preparing request")
   531  		return
   532  	}
   533  
   534  	resp, err := client.GetPropertiesSender(req)
   535  	if err != nil {
   536  		result.Response = resp
   537  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", resp, "Failure sending request")
   538  		return
   539  	}
   540  
   541  	result, err = client.GetPropertiesResponder(resp)
   542  	if err != nil {
   543  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "GetProperties", resp, "Failure responding to request")
   544  		return
   545  	}
   546  
   547  	return
   548  }
   549  
   550  // GetPropertiesPreparer prepares the GetProperties request.
   551  func (client PathClient) GetPropertiesPreparer(ctx context.Context, filesystem string, pathParameter string, action PathGetPropertiesAction, upn *bool, xMsLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) {
   552  	urlParameters := map[string]interface{}{
   553  		"accountName": client.AccountName,
   554  		"dnsSuffix":   client.DNSSuffix,
   555  	}
   556  
   557  	pathParameters := map[string]interface{}{
   558  		"filesystem": autorest.Encode("path", filesystem),
   559  		"path":       autorest.Encode("path", pathParameter),
   560  	}
   561  
   562  	queryParameters := map[string]interface{}{}
   563  	if len(string(action)) > 0 {
   564  		queryParameters["action"] = autorest.Encode("query", action)
   565  	}
   566  	if upn != nil {
   567  		queryParameters["upn"] = autorest.Encode("query", *upn)
   568  	}
   569  	if timeout != nil {
   570  		queryParameters["timeout"] = autorest.Encode("query", *timeout)
   571  	}
   572  
   573  	preparer := autorest.CreatePreparer(
   574  		autorest.AsHead(),
   575  		autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters),
   576  		autorest.WithPathParameters("/{filesystem}/{path}", pathParameters),
   577  		autorest.WithQueryParameters(queryParameters))
   578  	if len(xMsLeaseID) > 0 {
   579  		preparer = autorest.DecoratePreparer(preparer,
   580  			autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID)))
   581  	}
   582  	if len(ifMatch) > 0 {
   583  		preparer = autorest.DecoratePreparer(preparer,
   584  			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
   585  	}
   586  	if len(ifNoneMatch) > 0 {
   587  		preparer = autorest.DecoratePreparer(preparer,
   588  			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
   589  	}
   590  	if len(ifModifiedSince) > 0 {
   591  		preparer = autorest.DecoratePreparer(preparer,
   592  			autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
   593  	}
   594  	if len(ifUnmodifiedSince) > 0 {
   595  		preparer = autorest.DecoratePreparer(preparer,
   596  			autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
   597  	}
   598  	if len(xMsClientRequestID) > 0 {
   599  		preparer = autorest.DecoratePreparer(preparer,
   600  			autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID)))
   601  	}
   602  	if len(xMsDate) > 0 {
   603  		preparer = autorest.DecoratePreparer(preparer,
   604  			autorest.WithHeader("x-ms-date", autorest.String(xMsDate)))
   605  	}
   606  	if len(client.XMsVersion) > 0 {
   607  		preparer = autorest.DecoratePreparer(preparer,
   608  			autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion)))
   609  	}
   610  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   611  }
   612  
   613  // GetPropertiesSender sends the GetProperties request. The method will close the
   614  // http.Response Body if it receives an error.
   615  func (client PathClient) GetPropertiesSender(req *http.Request) (*http.Response, error) {
   616  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   617  }
   618  
   619  // GetPropertiesResponder handles the response to the GetProperties request. The method always
   620  // closes the http.Response Body.
   621  func (client PathClient) GetPropertiesResponder(resp *http.Response) (result autorest.Response, err error) {
   622  	err = autorest.Respond(
   623  		resp,
   624  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   625  		autorest.ByClosing())
   626  	result.Response = resp
   627  	return
   628  }
   629  
   630  // Lease create and manage a lease to restrict write and delete access to the path. This operation supports conditional
   631  // HTTP requests.  For more information, see [Specifying Conditional Headers for Blob Service
   632  // Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
   633  // Parameters:
   634  // xMsLeaseAction - there are five lease actions: "acquire", "break", "change", "renew", and "release". Use
   635  // "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use
   636  // "break" to break an existing lease. When a lease is broken, the lease break period is allowed to elapse,
   637  // during which time no lease operation except break and release can be performed on the file. When a lease is
   638  // successfully broken, the response indicates the interval in seconds until a new lease can be acquired. Use
   639  // "change" and specify the current lease ID in "x-ms-lease-id" and the new lease ID in
   640  // "x-ms-proposed-lease-id" to change the lease ID of an active lease. Use "renew" and specify the
   641  // "x-ms-lease-id" to renew an existing lease. Use "release" and specify the "x-ms-lease-id" to release a
   642  // lease.
   643  // filesystem - the filesystem identifier.
   644  // pathParameter - the file or directory path.
   645  // xMsLeaseDuration - the lease duration is required to acquire a lease, and specifies the duration of the
   646  // lease in seconds.  The lease duration must be between 15 and 60 seconds or -1 for infinite lease.
   647  // xMsLeaseBreakPeriod - the lease break period duration is optional to break a lease, and  specifies the break
   648  // period of the lease in seconds.  The lease break  duration must be between 0 and 60 seconds.
   649  // xMsLeaseID - required when "x-ms-lease-action" is "renew", "change" or "release". For the renew and release
   650  // actions, this must match the current lease ID.
   651  // xMsProposedLeaseID - required when "x-ms-lease-action" is "acquire" or "change".  A lease will be acquired
   652  // with this lease ID if the operation is successful.
   653  // ifMatch - optional.  An ETag value. Specify this header to perform the operation only if the resource's ETag
   654  // matches the value specified. The ETag must be specified in quotes.
   655  // ifNoneMatch - optional.  An ETag value or the special wildcard ("*") value. Specify this header to perform
   656  // the operation only if the resource's ETag does not match the value specified. The ETag must be specified in
   657  // quotes.
   658  // ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the
   659  // resource has been modified since the specified date and time.
   660  // ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if
   661  // the resource has not been modified since the specified date and time.
   662  // xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation.
   663  // timeout - an optional operation timeout value in seconds. The period begins when the request is received by
   664  // the service. If the timeout value elapses before the operation completes, the operation fails.
   665  // xMsDate - specifies the Coordinated Universal Time (UTC) for the request.  This is required when using
   666  // shared key authorization.
   667  func (client PathClient) Lease(ctx context.Context, xMsLeaseAction PathLeaseAction, filesystem string, pathParameter string, xMsLeaseDuration *int32, xMsLeaseBreakPeriod *int32, xMsLeaseID string, xMsProposedLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) {
   668  	if tracing.IsEnabled() {
   669  		ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.Lease")
   670  		defer func() {
   671  			sc := -1
   672  			if result.Response != nil {
   673  				sc = result.Response.StatusCode
   674  			}
   675  			tracing.EndSpan(ctx, sc, err)
   676  		}()
   677  	}
   678  	if err := validation.Validate([]validation.Validation{
   679  		{TargetValue: xMsLeaseID,
   680  			Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false,
   681  				Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   682  		{TargetValue: xMsProposedLeaseID,
   683  			Constraints: []validation.Constraint{{Target: "xMsProposedLeaseID", Name: validation.Empty, Rule: false,
   684  				Chain: []validation.Constraint{{Target: "xMsProposedLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   685  		{TargetValue: filesystem,
   686  			Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil},
   687  				{Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}},
   688  		{TargetValue: xMsClientRequestID,
   689  			Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false,
   690  				Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   691  		{TargetValue: timeout,
   692  			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
   693  				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil {
   694  		return result, validation.NewError("storagedatalake.PathClient", "Lease", err.Error())
   695  	}
   696  
   697  	req, err := client.LeasePreparer(ctx, xMsLeaseAction, filesystem, pathParameter, xMsLeaseDuration, xMsLeaseBreakPeriod, xMsLeaseID, xMsProposedLeaseID, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate)
   698  	if err != nil {
   699  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", nil, "Failure preparing request")
   700  		return
   701  	}
   702  
   703  	resp, err := client.LeaseSender(req)
   704  	if err != nil {
   705  		result.Response = resp
   706  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", resp, "Failure sending request")
   707  		return
   708  	}
   709  
   710  	result, err = client.LeaseResponder(resp)
   711  	if err != nil {
   712  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Lease", resp, "Failure responding to request")
   713  		return
   714  	}
   715  
   716  	return
   717  }
   718  
   719  // LeasePreparer prepares the Lease request.
   720  func (client PathClient) LeasePreparer(ctx context.Context, xMsLeaseAction PathLeaseAction, filesystem string, pathParameter string, xMsLeaseDuration *int32, xMsLeaseBreakPeriod *int32, xMsLeaseID string, xMsProposedLeaseID string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) {
   721  	urlParameters := map[string]interface{}{
   722  		"accountName": client.AccountName,
   723  		"dnsSuffix":   client.DNSSuffix,
   724  	}
   725  
   726  	pathParameters := map[string]interface{}{
   727  		"filesystem": autorest.Encode("path", filesystem),
   728  		"path":       autorest.Encode("path", pathParameter),
   729  	}
   730  
   731  	queryParameters := map[string]interface{}{}
   732  	if timeout != nil {
   733  		queryParameters["timeout"] = autorest.Encode("query", *timeout)
   734  	}
   735  
   736  	preparer := autorest.CreatePreparer(
   737  		autorest.AsPost(),
   738  		autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters),
   739  		autorest.WithPathParameters("/{filesystem}/{path}", pathParameters),
   740  		autorest.WithQueryParameters(queryParameters),
   741  		autorest.WithHeader("x-ms-lease-action", autorest.String(xMsLeaseAction)))
   742  	if xMsLeaseDuration != nil {
   743  		preparer = autorest.DecoratePreparer(preparer,
   744  			autorest.WithHeader("x-ms-lease-duration", autorest.String(*xMsLeaseDuration)))
   745  	}
   746  	if xMsLeaseBreakPeriod != nil {
   747  		preparer = autorest.DecoratePreparer(preparer,
   748  			autorest.WithHeader("x-ms-lease-break-period", autorest.String(*xMsLeaseBreakPeriod)))
   749  	}
   750  	if len(xMsLeaseID) > 0 {
   751  		preparer = autorest.DecoratePreparer(preparer,
   752  			autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID)))
   753  	}
   754  	if len(xMsProposedLeaseID) > 0 {
   755  		preparer = autorest.DecoratePreparer(preparer,
   756  			autorest.WithHeader("x-ms-proposed-lease-id", autorest.String(xMsProposedLeaseID)))
   757  	}
   758  	if len(ifMatch) > 0 {
   759  		preparer = autorest.DecoratePreparer(preparer,
   760  			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
   761  	}
   762  	if len(ifNoneMatch) > 0 {
   763  		preparer = autorest.DecoratePreparer(preparer,
   764  			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
   765  	}
   766  	if len(ifModifiedSince) > 0 {
   767  		preparer = autorest.DecoratePreparer(preparer,
   768  			autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
   769  	}
   770  	if len(ifUnmodifiedSince) > 0 {
   771  		preparer = autorest.DecoratePreparer(preparer,
   772  			autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
   773  	}
   774  	if len(xMsClientRequestID) > 0 {
   775  		preparer = autorest.DecoratePreparer(preparer,
   776  			autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID)))
   777  	}
   778  	if len(xMsDate) > 0 {
   779  		preparer = autorest.DecoratePreparer(preparer,
   780  			autorest.WithHeader("x-ms-date", autorest.String(xMsDate)))
   781  	}
   782  	if len(client.XMsVersion) > 0 {
   783  		preparer = autorest.DecoratePreparer(preparer,
   784  			autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion)))
   785  	}
   786  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   787  }
   788  
   789  // LeaseSender sends the Lease request. The method will close the
   790  // http.Response Body if it receives an error.
   791  func (client PathClient) LeaseSender(req *http.Request) (*http.Response, error) {
   792  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   793  }
   794  
   795  // LeaseResponder handles the response to the Lease request. The method always
   796  // closes the http.Response Body.
   797  func (client PathClient) LeaseResponder(resp *http.Response) (result autorest.Response, err error) {
   798  	err = autorest.Respond(
   799  		resp,
   800  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
   801  		autorest.ByClosing())
   802  	result.Response = resp
   803  	return
   804  }
   805  
   806  // List list filesystem paths and their properties.
   807  // Parameters:
   808  // recursive - if "true", all paths are listed; otherwise, only paths at the root of the filesystem are listed.
   809  // If "directory" is specified, the list will only include paths that share the same root.
   810  // filesystem - the filesystem identifier.  The value must start and end with a letter or number and must
   811  // contain only letters, numbers, and the dash (-) character.  Consecutive dashes are not permitted.  All
   812  // letters must be lowercase.  The value must have between 3 and 63 characters.
   813  // directory - filters results to paths within the specified directory. An error occurs if the directory does
   814  // not exist.
   815  // continuation - the number of paths returned with each invocation is limited. If the number of paths to be
   816  // returned exceeds this limit, a continuation token is returned in the response header x-ms-continuation. When
   817  // a continuation token is  returned in the response, it must be specified in a subsequent invocation of the
   818  // list operation to continue listing the paths.
   819  // maxResults - an optional value that specifies the maximum number of items to return. If omitted or greater
   820  // than 5,000, the response will include up to 5,000 items.
   821  // upn - optional. Valid only when Hierarchical Namespace is enabled for the account. If "true", the user
   822  // identity values returned in the owner and group fields of each list entry will be transformed from Azure
   823  // Active Directory Object IDs to User Principal Names.  If "false", the values will be returned as Azure
   824  // Active Directory Object IDs. The default value is false. Note that group and application Object IDs are not
   825  // translated because they do not have unique friendly names.
   826  // xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation.
   827  // timeout - an optional operation timeout value in seconds. The period begins when the request is received by
   828  // the service. If the timeout value elapses before the operation completes, the operation fails.
   829  // xMsDate - specifies the Coordinated Universal Time (UTC) for the request.  This is required when using
   830  // shared key authorization.
   831  func (client PathClient) List(ctx context.Context, recursive bool, filesystem string, directory string, continuation string, maxResults *int32, upn *bool, xMsClientRequestID string, timeout *int32, xMsDate string) (result PathList, err error) {
   832  	if tracing.IsEnabled() {
   833  		ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.List")
   834  		defer func() {
   835  			sc := -1
   836  			if result.Response.Response != nil {
   837  				sc = result.Response.Response.StatusCode
   838  			}
   839  			tracing.EndSpan(ctx, sc, err)
   840  		}()
   841  	}
   842  	if err := validation.Validate([]validation.Validation{
   843  		{TargetValue: maxResults,
   844  			Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false,
   845  				Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}},
   846  		{TargetValue: filesystem,
   847  			Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil},
   848  				{Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}},
   849  		{TargetValue: xMsClientRequestID,
   850  			Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false,
   851  				Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   852  		{TargetValue: timeout,
   853  			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
   854  				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil {
   855  		return result, validation.NewError("storagedatalake.PathClient", "List", err.Error())
   856  	}
   857  
   858  	req, err := client.ListPreparer(ctx, recursive, filesystem, directory, continuation, maxResults, upn, xMsClientRequestID, timeout, xMsDate)
   859  	if err != nil {
   860  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", nil, "Failure preparing request")
   861  		return
   862  	}
   863  
   864  	resp, err := client.ListSender(req)
   865  	if err != nil {
   866  		result.Response = autorest.Response{Response: resp}
   867  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", resp, "Failure sending request")
   868  		return
   869  	}
   870  
   871  	result, err = client.ListResponder(resp)
   872  	if err != nil {
   873  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "List", resp, "Failure responding to request")
   874  		return
   875  	}
   876  
   877  	return
   878  }
   879  
   880  // ListPreparer prepares the List request.
   881  func (client PathClient) ListPreparer(ctx context.Context, recursive bool, filesystem string, directory string, continuation string, maxResults *int32, upn *bool, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) {
   882  	urlParameters := map[string]interface{}{
   883  		"accountName": client.AccountName,
   884  		"dnsSuffix":   client.DNSSuffix,
   885  	}
   886  
   887  	pathParameters := map[string]interface{}{
   888  		"filesystem": autorest.Encode("path", filesystem),
   889  	}
   890  
   891  	queryParameters := map[string]interface{}{
   892  		"recursive": autorest.Encode("query", recursive),
   893  		"resource":  autorest.Encode("query", "filesystem"),
   894  	}
   895  	if len(directory) > 0 {
   896  		queryParameters["directory"] = autorest.Encode("query", directory)
   897  	}
   898  	if len(continuation) > 0 {
   899  		queryParameters["continuation"] = autorest.Encode("query", continuation)
   900  	}
   901  	if maxResults != nil {
   902  		queryParameters["maxResults"] = autorest.Encode("query", *maxResults)
   903  	}
   904  	if upn != nil {
   905  		queryParameters["upn"] = autorest.Encode("query", *upn)
   906  	}
   907  	if timeout != nil {
   908  		queryParameters["timeout"] = autorest.Encode("query", *timeout)
   909  	}
   910  
   911  	preparer := autorest.CreatePreparer(
   912  		autorest.AsGet(),
   913  		autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters),
   914  		autorest.WithPathParameters("/{filesystem}", pathParameters),
   915  		autorest.WithQueryParameters(queryParameters))
   916  	if len(xMsClientRequestID) > 0 {
   917  		preparer = autorest.DecoratePreparer(preparer,
   918  			autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID)))
   919  	}
   920  	if len(xMsDate) > 0 {
   921  		preparer = autorest.DecoratePreparer(preparer,
   922  			autorest.WithHeader("x-ms-date", autorest.String(xMsDate)))
   923  	}
   924  	if len(client.XMsVersion) > 0 {
   925  		preparer = autorest.DecoratePreparer(preparer,
   926  			autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion)))
   927  	}
   928  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
   929  }
   930  
   931  // ListSender sends the List request. The method will close the
   932  // http.Response Body if it receives an error.
   933  func (client PathClient) ListSender(req *http.Request) (*http.Response, error) {
   934  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   935  }
   936  
   937  // ListResponder handles the response to the List request. The method always
   938  // closes the http.Response Body.
   939  func (client PathClient) ListResponder(resp *http.Response) (result PathList, err error) {
   940  	err = autorest.Respond(
   941  		resp,
   942  		azure.WithErrorUnlessStatusCode(http.StatusOK),
   943  		autorest.ByUnmarshallingJSON(&result),
   944  		autorest.ByClosing())
   945  	result.Response = autorest.Response{Response: resp}
   946  	return
   947  }
   948  
   949  // Read read the contents of a file.  For read operations, range requests are supported. This operation supports
   950  // conditional HTTP requests.  For more information, see [Specifying Conditional Headers for Blob Service
   951  // Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
   952  // Parameters:
   953  // filesystem - the filesystem identifier.
   954  // pathParameter - the file or directory path.
   955  // rangeParameter - the HTTP Range request header specifies one or more byte ranges of the resource to be
   956  // retrieved.
   957  // xMsLeaseID - optional. If this header is specified, the operation will be performed only if both of the
   958  // following conditions are met: i) the path's lease is currently active and ii) the lease ID specified in the
   959  // request matches that of the path.
   960  // xMsRangeGetContentMd5 - optional. When this header is set to "true" and specified together with the Range
   961  // header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4MB in
   962  // size. If this header is specified without the Range header, the service returns status code 400 (Bad
   963  // Request). If this header is set to true when the range exceeds 4 MB in size, the service returns status code
   964  // 400 (Bad Request).
   965  // ifMatch - optional.  An ETag value. Specify this header to perform the operation only if the resource's ETag
   966  // matches the value specified. The ETag must be specified in quotes.
   967  // ifNoneMatch - optional.  An ETag value or the special wildcard ("*") value. Specify this header to perform
   968  // the operation only if the resource's ETag does not match the value specified. The ETag must be specified in
   969  // quotes.
   970  // ifModifiedSince - optional. A date and time value. Specify this header to perform the operation only if the
   971  // resource has been modified since the specified date and time.
   972  // ifUnmodifiedSince - optional. A date and time value. Specify this header to perform the operation only if
   973  // the resource has not been modified since the specified date and time.
   974  // xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation.
   975  // timeout - an optional operation timeout value in seconds. The period begins when the request is received by
   976  // the service. If the timeout value elapses before the operation completes, the operation fails.
   977  // xMsDate - specifies the Coordinated Universal Time (UTC) for the request.  This is required when using
   978  // shared key authorization.
   979  func (client PathClient) Read(ctx context.Context, filesystem string, pathParameter string, rangeParameter string, xMsLeaseID string, xMsRangeGetContentMd5 *bool, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (result ReadCloser, err error) {
   980  	if tracing.IsEnabled() {
   981  		ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.Read")
   982  		defer func() {
   983  			sc := -1
   984  			if result.Response.Response != nil {
   985  				sc = result.Response.Response.StatusCode
   986  			}
   987  			tracing.EndSpan(ctx, sc, err)
   988  		}()
   989  	}
   990  	if err := validation.Validate([]validation.Validation{
   991  		{TargetValue: xMsLeaseID,
   992  			Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false,
   993  				Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
   994  		{TargetValue: filesystem,
   995  			Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil},
   996  				{Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}},
   997  		{TargetValue: xMsClientRequestID,
   998  			Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false,
   999  				Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
  1000  		{TargetValue: timeout,
  1001  			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
  1002  				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil {
  1003  		return result, validation.NewError("storagedatalake.PathClient", "Read", err.Error())
  1004  	}
  1005  
  1006  	req, err := client.ReadPreparer(ctx, filesystem, pathParameter, rangeParameter, xMsLeaseID, xMsRangeGetContentMd5, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, xMsClientRequestID, timeout, xMsDate)
  1007  	if err != nil {
  1008  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", nil, "Failure preparing request")
  1009  		return
  1010  	}
  1011  
  1012  	resp, err := client.ReadSender(req)
  1013  	if err != nil {
  1014  		result.Response = autorest.Response{Response: resp}
  1015  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", resp, "Failure sending request")
  1016  		return
  1017  	}
  1018  
  1019  	result, err = client.ReadResponder(resp)
  1020  	if err != nil {
  1021  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Read", resp, "Failure responding to request")
  1022  		return
  1023  	}
  1024  
  1025  	return
  1026  }
  1027  
  1028  // ReadPreparer prepares the Read request.
  1029  func (client PathClient) ReadPreparer(ctx context.Context, filesystem string, pathParameter string, rangeParameter string, xMsLeaseID string, xMsRangeGetContentMd5 *bool, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) {
  1030  	urlParameters := map[string]interface{}{
  1031  		"accountName": client.AccountName,
  1032  		"dnsSuffix":   client.DNSSuffix,
  1033  	}
  1034  
  1035  	pathParameters := map[string]interface{}{
  1036  		"filesystem": autorest.Encode("path", filesystem),
  1037  		"path":       autorest.Encode("path", pathParameter),
  1038  	}
  1039  
  1040  	queryParameters := map[string]interface{}{}
  1041  	if timeout != nil {
  1042  		queryParameters["timeout"] = autorest.Encode("query", *timeout)
  1043  	}
  1044  
  1045  	preparer := autorest.CreatePreparer(
  1046  		autorest.AsGet(),
  1047  		autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters),
  1048  		autorest.WithPathParameters("/{filesystem}/{path}", pathParameters),
  1049  		autorest.WithQueryParameters(queryParameters))
  1050  	if len(rangeParameter) > 0 {
  1051  		preparer = autorest.DecoratePreparer(preparer,
  1052  			autorest.WithHeader("Range", autorest.String(rangeParameter)))
  1053  	}
  1054  	if len(xMsLeaseID) > 0 {
  1055  		preparer = autorest.DecoratePreparer(preparer,
  1056  			autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID)))
  1057  	}
  1058  	if xMsRangeGetContentMd5 != nil {
  1059  		preparer = autorest.DecoratePreparer(preparer,
  1060  			autorest.WithHeader("x-ms-range-get-content-md5", autorest.String(xMsRangeGetContentMd5)))
  1061  	}
  1062  	if len(ifMatch) > 0 {
  1063  		preparer = autorest.DecoratePreparer(preparer,
  1064  			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
  1065  	}
  1066  	if len(ifNoneMatch) > 0 {
  1067  		preparer = autorest.DecoratePreparer(preparer,
  1068  			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
  1069  	}
  1070  	if len(ifModifiedSince) > 0 {
  1071  		preparer = autorest.DecoratePreparer(preparer,
  1072  			autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
  1073  	}
  1074  	if len(ifUnmodifiedSince) > 0 {
  1075  		preparer = autorest.DecoratePreparer(preparer,
  1076  			autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
  1077  	}
  1078  	if len(xMsClientRequestID) > 0 {
  1079  		preparer = autorest.DecoratePreparer(preparer,
  1080  			autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID)))
  1081  	}
  1082  	if len(xMsDate) > 0 {
  1083  		preparer = autorest.DecoratePreparer(preparer,
  1084  			autorest.WithHeader("x-ms-date", autorest.String(xMsDate)))
  1085  	}
  1086  	if len(client.XMsVersion) > 0 {
  1087  		preparer = autorest.DecoratePreparer(preparer,
  1088  			autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion)))
  1089  	}
  1090  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1091  }
  1092  
  1093  // ReadSender sends the Read request. The method will close the
  1094  // http.Response Body if it receives an error.
  1095  func (client PathClient) ReadSender(req *http.Request) (*http.Response, error) {
  1096  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1097  }
  1098  
  1099  // ReadResponder handles the response to the Read request. The method always
  1100  // closes the http.Response Body.
  1101  func (client PathClient) ReadResponder(resp *http.Response) (result ReadCloser, err error) {
  1102  	result.Value = &resp.Body
  1103  	err = autorest.Respond(
  1104  		resp,
  1105  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusPartialContent))
  1106  	result.Response = autorest.Response{Response: resp}
  1107  	return
  1108  }
  1109  
  1110  // Update uploads data to be appended to a file, flushes (writes) previously uploaded data to a file, sets properties
  1111  // for a file or directory, or sets access control for a file or directory. Data can only be appended to a file. This
  1112  // operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob
  1113  // Service
  1114  // Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations).
  1115  // Parameters:
  1116  // action - the action must be "append" to upload data to be appended to a file, "flush" to flush previously
  1117  // uploaded data to a file, "setProperties" to set the properties of a file or directory, or "setAccessControl"
  1118  // to set the owner, group, permissions, or access control list for a file or directory.  Note that
  1119  // Hierarchical Namespace must be enabled for the account in order to use access control.  Also note that the
  1120  // Access Control List (ACL) includes permissions for the owner, owning group, and others, so the
  1121  // x-ms-permissions and x-ms-acl request headers are mutually exclusive.
  1122  // filesystem - the filesystem identifier.
  1123  // pathParameter - the file or directory path.
  1124  // position - this parameter allows the caller to upload data in parallel and control the order in which it is
  1125  // appended to the file.  It is required when uploading data to be appended to the file and when flushing
  1126  // previously uploaded data to the file.  The value must be the position where the data is to be appended.
  1127  // Uploaded data is not immediately flushed, or written, to the file.  To flush, the previously uploaded data
  1128  // must be contiguous, the position parameter must be specified and equal to the length of the file after all
  1129  // data has been written, and there must not be a request entity body included with the request.
  1130  // retainUncommittedData - valid only for flush operations.  If "true", uncommitted data is retained after the
  1131  // flush operation completes; otherwise, the uncommitted data is deleted after the flush operation.  The
  1132  // default is false.  Data at offsets less than the specified position are written to the file when flush
  1133  // succeeds, but this optional parameter allows data after the flush position to be retained for a future flush
  1134  // operation.
  1135  // closeParameter - azure Storage Events allow applications to receive notifications when files change. When
  1136  // Azure Storage Events are enabled, a file changed event is raised. This event has a property indicating
  1137  // whether this is the final change to distinguish the difference between an intermediate flush to a file
  1138  // stream and the final close of a file stream. The close query parameter is valid only when the action is
  1139  // "flush" and change notifications are enabled. If the value of close is "true" and the flush operation
  1140  // completes successfully, the service raises a file change notification with a property indicating that this
  1141  // is the final update (the file stream has been closed). If "false" a change notification is raised indicating
  1142  // the file has changed. The default is false. This query parameter is set to true by the Hadoop ABFS driver to
  1143  // indicate that the file stream has been closed."
  1144  // contentLength - required for "Append Data" and "Flush Data".  Must be 0 for "Flush Data".  Must be the
  1145  // length of the request content in bytes for "Append Data".
  1146  // contentMD5 - optional. An MD5 hash of the request content. This header is valid on "Append" and "Flush"
  1147  // operations. This hash is used to verify the integrity of the request content during transport. When this
  1148  // header is specified, the storage service compares the hash of the content that has arrived with this header
  1149  // value. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). Note that
  1150  // this MD5 hash is not stored with the file. This header is associated with the request content, and not with
  1151  // the stored content of the file itself.
  1152  // xMsLeaseID - the lease ID must be specified if there is an active lease.
  1153  // xMsCacheControl - optional and only valid for flush and set properties operations.  The service stores this
  1154  // value and includes it in the "Cache-Control" response header for "Read File" operations.
  1155  // xMsContentType - optional and only valid for flush and set properties operations.  The service stores this
  1156  // value and includes it in the "Content-Type" response header for "Read File" operations.
  1157  // xMsContentDisposition - optional and only valid for flush and set properties operations.  The service stores
  1158  // this value and includes it in the "Content-Disposition" response header for "Read File" operations.
  1159  // xMsContentEncoding - optional and only valid for flush and set properties operations.  The service stores
  1160  // this value and includes it in the "Content-Encoding" response header for "Read File" operations.
  1161  // xMsContentLanguage - optional and only valid for flush and set properties operations.  The service stores
  1162  // this value and includes it in the "Content-Language" response header for "Read File" operations.
  1163  // xMsContentMd5 - optional and only valid for "Flush & Set Properties" operations.  The service stores this
  1164  // value and includes it in the "Content-Md5" response header for "Read & Get Properties" operations. If this
  1165  // property is not specified on the request, then the property will be cleared for the file. Subsequent calls
  1166  // to "Read & Get Properties" will not return this property unless it is explicitly set on that file again.
  1167  // xMsProperties - optional.  User-defined properties to be stored with the file or directory, in the format of
  1168  // a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded
  1169  // string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. Valid only
  1170  // for the setProperties operation. If the file or directory exists, any properties not included in the list
  1171  // will be removed.  All properties are removed if the header is omitted.  To merge new and existing
  1172  // properties, first get all existing properties and the current E-Tag, then make a conditional request with
  1173  // the E-Tag and include values for all properties.
  1174  // xMsOwner - optional and valid only for the setAccessControl operation. Sets the owner of the file or
  1175  // directory.
  1176  // xMsGroup - optional and valid only for the setAccessControl operation. Sets the owning group of the file or
  1177  // directory.
  1178  // xMsPermissions - optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX
  1179  // access permissions for the file owner, the file owning group, and others. Each class may be granted read,
  1180  // write, or execute permission.  The sticky bit is also supported.  Both symbolic (rwxrw-rw-) and 4-digit
  1181  // octal notation (e.g. 0766) are supported. Invalid in conjunction with x-ms-acl.
  1182  // xMsACL - optional and valid only for the setAccessControl operation. Sets POSIX access control rights on
  1183  // files and directories. The value is a comma-separated list of access control entries that fully replaces the
  1184  // existing access control list (ACL).  Each access control entry (ACE) consists of a scope, a type, a user or
  1185  // group identifier, and permissions in the format "[scope:][type]:[id]:[permissions]". The scope must be
  1186  // "default" to indicate the ACE belongs to the default ACL for a directory; otherwise scope is implicit and
  1187  // the ACE belongs to the access ACL.  There are four ACE types: "user" grants rights to the owner or a named
  1188  // user, "group" grants rights to the owning group or a named group, "mask" restricts rights granted to named
  1189  // users and the members of groups, and "other" grants rights to all users not found in any of the other
  1190  // entries. The user or group identifier is omitted for entries of type "mask" and "other".  The user or group
  1191  // identifier is also omitted for the owner and owning group.  The permission field is a 3-character sequence
  1192  // where the first character is 'r' to grant read access, the second character is 'w' to grant write access,
  1193  // and the third character is 'x' to grant execute permission.  If access is not granted, the '-' character is
  1194  // used to denote that the permission is denied. For example, the following ACL grants read, write, and execute
  1195  // rights to the file owner and john.doe@contoso, the read right to the owning group, and nothing to everyone
  1196  // else: "user::rwx,user:john.doe@contoso:rwx,group::r--,other::---,mask=rwx". Invalid in conjunction with
  1197  // x-ms-permissions.
  1198  // ifMatch - optional for Flush Data and Set Properties, but invalid for Append Data.  An ETag value. Specify
  1199  // this header to perform the operation only if the resource's ETag matches the value specified. The ETag must
  1200  // be specified in quotes.
  1201  // ifNoneMatch - optional for Flush Data and Set Properties, but invalid for Append Data.  An ETag value or the
  1202  // special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does
  1203  // not match the value specified. The ETag must be specified in quotes.
  1204  // ifModifiedSince - optional for Flush Data and Set Properties, but invalid for Append Data. A date and time
  1205  // value. Specify this header to perform the operation only if the resource has been modified since the
  1206  // specified date and time.
  1207  // ifUnmodifiedSince - optional for Flush Data and Set Properties, but invalid for Append Data. A date and time
  1208  // value. Specify this header to perform the operation only if the resource has not been modified since the
  1209  // specified date and time.
  1210  // requestBody - valid only for append operations.  The data to be uploaded and appended to the file.
  1211  // xMsClientRequestID - a UUID recorded in the analytics logs for troubleshooting and correlation.
  1212  // timeout - an optional operation timeout value in seconds. The period begins when the request is received by
  1213  // the service. If the timeout value elapses before the operation completes, the operation fails.
  1214  // xMsDate - specifies the Coordinated Universal Time (UTC) for the request.  This is required when using
  1215  // shared key authorization.
  1216  func (client PathClient) Update(ctx context.Context, action PathUpdateAction, filesystem string, pathParameter string, position *int64, retainUncommittedData *bool, closeParameter *bool, contentLength *int64, contentMD5 string, xMsLeaseID string, xMsCacheControl string, xMsContentType string, xMsContentDisposition string, xMsContentEncoding string, xMsContentLanguage string, xMsContentMd5 string, xMsProperties string, xMsOwner string, xMsGroup string, xMsPermissions string, xMsACL string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, requestBody io.ReadCloser, xMsClientRequestID string, timeout *int32, xMsDate string) (result autorest.Response, err error) {
  1217  	if tracing.IsEnabled() {
  1218  		ctx = tracing.StartSpan(ctx, fqdn+"/PathClient.Update")
  1219  		defer func() {
  1220  			sc := -1
  1221  			if result.Response != nil {
  1222  				sc = result.Response.StatusCode
  1223  			}
  1224  			tracing.EndSpan(ctx, sc, err)
  1225  		}()
  1226  	}
  1227  	if err := validation.Validate([]validation.Validation{
  1228  		{TargetValue: contentLength,
  1229  			Constraints: []validation.Constraint{{Target: "contentLength", Name: validation.Null, Rule: false,
  1230  				Chain: []validation.Constraint{{Target: "contentLength", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}},
  1231  		{TargetValue: xMsLeaseID,
  1232  			Constraints: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Empty, Rule: false,
  1233  				Chain: []validation.Constraint{{Target: "xMsLeaseID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
  1234  		{TargetValue: filesystem,
  1235  			Constraints: []validation.Constraint{{Target: "filesystem", Name: validation.MaxLength, Rule: 63, Chain: nil},
  1236  				{Target: "filesystem", Name: validation.MinLength, Rule: 3, Chain: nil}}},
  1237  		{TargetValue: xMsClientRequestID,
  1238  			Constraints: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Empty, Rule: false,
  1239  				Chain: []validation.Constraint{{Target: "xMsClientRequestID", Name: validation.Pattern, Rule: `^[{(]?[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}[)}]?$`, Chain: nil}}}}},
  1240  		{TargetValue: timeout,
  1241  			Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false,
  1242  				Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil {
  1243  		return result, validation.NewError("storagedatalake.PathClient", "Update", err.Error())
  1244  	}
  1245  
  1246  	req, err := client.UpdatePreparer(ctx, action, filesystem, pathParameter, position, retainUncommittedData, closeParameter, contentLength, contentMD5, xMsLeaseID, xMsCacheControl, xMsContentType, xMsContentDisposition, xMsContentEncoding, xMsContentLanguage, xMsContentMd5, xMsProperties, xMsOwner, xMsGroup, xMsPermissions, xMsACL, ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince, requestBody, xMsClientRequestID, timeout, xMsDate)
  1247  	if err != nil {
  1248  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", nil, "Failure preparing request")
  1249  		return
  1250  	}
  1251  
  1252  	resp, err := client.UpdateSender(req)
  1253  	if err != nil {
  1254  		result.Response = resp
  1255  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", resp, "Failure sending request")
  1256  		return
  1257  	}
  1258  
  1259  	result, err = client.UpdateResponder(resp)
  1260  	if err != nil {
  1261  		err = autorest.NewErrorWithError(err, "storagedatalake.PathClient", "Update", resp, "Failure responding to request")
  1262  		return
  1263  	}
  1264  
  1265  	return
  1266  }
  1267  
  1268  // UpdatePreparer prepares the Update request.
  1269  func (client PathClient) UpdatePreparer(ctx context.Context, action PathUpdateAction, filesystem string, pathParameter string, position *int64, retainUncommittedData *bool, closeParameter *bool, contentLength *int64, contentMD5 string, xMsLeaseID string, xMsCacheControl string, xMsContentType string, xMsContentDisposition string, xMsContentEncoding string, xMsContentLanguage string, xMsContentMd5 string, xMsProperties string, xMsOwner string, xMsGroup string, xMsPermissions string, xMsACL string, ifMatch string, ifNoneMatch string, ifModifiedSince string, ifUnmodifiedSince string, requestBody io.ReadCloser, xMsClientRequestID string, timeout *int32, xMsDate string) (*http.Request, error) {
  1270  	urlParameters := map[string]interface{}{
  1271  		"accountName": client.AccountName,
  1272  		"dnsSuffix":   client.DNSSuffix,
  1273  	}
  1274  
  1275  	pathParameters := map[string]interface{}{
  1276  		"filesystem": autorest.Encode("path", filesystem),
  1277  		"path":       autorest.Encode("path", pathParameter),
  1278  	}
  1279  
  1280  	queryParameters := map[string]interface{}{
  1281  		"action": autorest.Encode("query", action),
  1282  	}
  1283  	if position != nil {
  1284  		queryParameters["position"] = autorest.Encode("query", *position)
  1285  	}
  1286  	if retainUncommittedData != nil {
  1287  		queryParameters["retainUncommittedData"] = autorest.Encode("query", *retainUncommittedData)
  1288  	}
  1289  	if closeParameter != nil {
  1290  		queryParameters["close"] = autorest.Encode("query", *closeParameter)
  1291  	}
  1292  	if timeout != nil {
  1293  		queryParameters["timeout"] = autorest.Encode("query", *timeout)
  1294  	}
  1295  
  1296  	preparer := autorest.CreatePreparer(
  1297  		autorest.AsContentType("application/octet-stream"),
  1298  		autorest.AsPatch(),
  1299  		autorest.WithCustomBaseURL("https://{accountName}.{dnsSuffix}", urlParameters),
  1300  		autorest.WithPathParameters("/{filesystem}/{path}", pathParameters),
  1301  		autorest.WithQueryParameters(queryParameters))
  1302  	if requestBody != nil {
  1303  		preparer = autorest.DecoratePreparer(preparer,
  1304  			autorest.WithFile(requestBody))
  1305  	}
  1306  	if contentLength != nil {
  1307  		preparer = autorest.DecoratePreparer(preparer,
  1308  			autorest.WithHeader("Content-Length", autorest.String(*contentLength)))
  1309  	}
  1310  	if len(contentMD5) > 0 {
  1311  		preparer = autorest.DecoratePreparer(preparer,
  1312  			autorest.WithHeader("Content-MD5", autorest.String(contentMD5)))
  1313  	}
  1314  	if len(xMsLeaseID) > 0 {
  1315  		preparer = autorest.DecoratePreparer(preparer,
  1316  			autorest.WithHeader("x-ms-lease-id", autorest.String(xMsLeaseID)))
  1317  	}
  1318  	if len(xMsCacheControl) > 0 {
  1319  		preparer = autorest.DecoratePreparer(preparer,
  1320  			autorest.WithHeader("x-ms-cache-control", autorest.String(xMsCacheControl)))
  1321  	}
  1322  	if len(xMsContentType) > 0 {
  1323  		preparer = autorest.DecoratePreparer(preparer,
  1324  			autorest.WithHeader("x-ms-content-type", autorest.String(xMsContentType)))
  1325  	}
  1326  	if len(xMsContentDisposition) > 0 {
  1327  		preparer = autorest.DecoratePreparer(preparer,
  1328  			autorest.WithHeader("x-ms-content-disposition", autorest.String(xMsContentDisposition)))
  1329  	}
  1330  	if len(xMsContentEncoding) > 0 {
  1331  		preparer = autorest.DecoratePreparer(preparer,
  1332  			autorest.WithHeader("x-ms-content-encoding", autorest.String(xMsContentEncoding)))
  1333  	}
  1334  	if len(xMsContentLanguage) > 0 {
  1335  		preparer = autorest.DecoratePreparer(preparer,
  1336  			autorest.WithHeader("x-ms-content-language", autorest.String(xMsContentLanguage)))
  1337  	}
  1338  	if len(xMsContentMd5) > 0 {
  1339  		preparer = autorest.DecoratePreparer(preparer,
  1340  			autorest.WithHeader("x-ms-content-md5", autorest.String(xMsContentMd5)))
  1341  	}
  1342  	if len(xMsProperties) > 0 {
  1343  		preparer = autorest.DecoratePreparer(preparer,
  1344  			autorest.WithHeader("x-ms-properties", autorest.String(xMsProperties)))
  1345  	}
  1346  	if len(xMsOwner) > 0 {
  1347  		preparer = autorest.DecoratePreparer(preparer,
  1348  			autorest.WithHeader("x-ms-owner", autorest.String(xMsOwner)))
  1349  	}
  1350  	if len(xMsGroup) > 0 {
  1351  		preparer = autorest.DecoratePreparer(preparer,
  1352  			autorest.WithHeader("x-ms-group", autorest.String(xMsGroup)))
  1353  	}
  1354  	if len(xMsPermissions) > 0 {
  1355  		preparer = autorest.DecoratePreparer(preparer,
  1356  			autorest.WithHeader("x-ms-permissions", autorest.String(xMsPermissions)))
  1357  	}
  1358  	if len(xMsACL) > 0 {
  1359  		preparer = autorest.DecoratePreparer(preparer,
  1360  			autorest.WithHeader("x-ms-acl", autorest.String(xMsACL)))
  1361  	}
  1362  	if len(ifMatch) > 0 {
  1363  		preparer = autorest.DecoratePreparer(preparer,
  1364  			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
  1365  	}
  1366  	if len(ifNoneMatch) > 0 {
  1367  		preparer = autorest.DecoratePreparer(preparer,
  1368  			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
  1369  	}
  1370  	if len(ifModifiedSince) > 0 {
  1371  		preparer = autorest.DecoratePreparer(preparer,
  1372  			autorest.WithHeader("If-Modified-Since", autorest.String(ifModifiedSince)))
  1373  	}
  1374  	if len(ifUnmodifiedSince) > 0 {
  1375  		preparer = autorest.DecoratePreparer(preparer,
  1376  			autorest.WithHeader("If-Unmodified-Since", autorest.String(ifUnmodifiedSince)))
  1377  	}
  1378  	if len(xMsClientRequestID) > 0 {
  1379  		preparer = autorest.DecoratePreparer(preparer,
  1380  			autorest.WithHeader("x-ms-client-request-id", autorest.String(xMsClientRequestID)))
  1381  	}
  1382  	if len(xMsDate) > 0 {
  1383  		preparer = autorest.DecoratePreparer(preparer,
  1384  			autorest.WithHeader("x-ms-date", autorest.String(xMsDate)))
  1385  	}
  1386  	if len(client.XMsVersion) > 0 {
  1387  		preparer = autorest.DecoratePreparer(preparer,
  1388  			autorest.WithHeader("x-ms-version", autorest.String(client.XMsVersion)))
  1389  	}
  1390  	return preparer.Prepare((&http.Request{}).WithContext(ctx))
  1391  }
  1392  
  1393  // UpdateSender sends the Update request. The method will close the
  1394  // http.Response Body if it receives an error.
  1395  func (client PathClient) UpdateSender(req *http.Request) (*http.Response, error) {
  1396  	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1397  }
  1398  
  1399  // UpdateResponder handles the response to the Update request. The method always
  1400  // closes the http.Response Body.
  1401  func (client PathClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
  1402  	err = autorest.Respond(
  1403  		resp,
  1404  		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
  1405  		autorest.ByClosing())
  1406  	result.Response = resp
  1407  	return
  1408  }
  1409  

View as plain text