| 1 | package containersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/ |
| 2 | |
| 3 | import ( |
| 4 | "contextscip-go gomod github.com/golang/go/src go1.13 context/" |
| 5 | "net/httpscip-go gomod github.com/golang/go/src go1.13 `net/http`/" |
| 6 | |
| 7 | "github.com/Azure/go-autorest/autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/" |
| 8 | "github.com/Azure/go-autorest/autorest/azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/" |
| 9 | "github.com/Azure/go-autorest/autorest/validationscip-go gomod github.com/Azure/go-autorest/autorest/validation v0.3.1 `github.com/Azure/go-autorest/autorest/validation`/" |
| 10 | "github.com/tombuildsstuff/giovanni/storage/internal/endpointsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/" |
| 11 | ) |
| 12 | |
| 13 | // SetAccessControl sets the Access Control for a Container without a Lease ID |
| 14 | func (client Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#) SetAccessControlscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControl().(ctx contextscip-go gomod github.com/golang/go/src go1.13 context/.Contextscip-go gomod github.com/golang/go/src go1.13 context/Context#, accountName, containerName string, level AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/AccessLevel#) (autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Responsescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Response#, error) { |
| 15 | return client.SetAccessControlWithLeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseID().(ctx, accountName, containerName, "", level) |
| 16 | } |
| 17 | |
| 18 | // SetAccessControlWithLeaseID sets the Access Control for a Container using the specified Lease ID |
| 19 | func (client Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#) SetAccessControlWithLeaseIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseID().(ctx contextscip-go gomod github.com/golang/go/src go1.13 context/.Contextscip-go gomod github.com/golang/go/src go1.13 context/Context#, accountName, containerName, leaseID string, level AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/AccessLevel#) (result autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Responsescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Response#, err error) { |
| 20 | if accountName == "" { |
| 21 | return result, validationscip-go gomod github.com/Azure/go-autorest/autorest/validation v0.3.1 `github.com/Azure/go-autorest/autorest/validation`/.NewErrorscip-go gomod github.com/Azure/go-autorest/autorest/validation v0.3.1 `github.com/Azure/go-autorest/autorest/validation`/NewError().("containers.Client", "SetAccessControl", "`accountName` cannot be an empty string.") |
| 22 | } |
| 23 | if containerName == "" { |
| 24 | return result, validationscip-go gomod github.com/Azure/go-autorest/autorest/validation v0.3.1 `github.com/Azure/go-autorest/autorest/validation`/.NewErrorscip-go gomod github.com/Azure/go-autorest/autorest/validation v0.3.1 `github.com/Azure/go-autorest/autorest/validation`/NewError().("containers.Client", "SetAccessControl", "`containerName` cannot be an empty string.") |
| 25 | } |
| 26 | |
| 27 | req, err := client.SetAccessControlWithLeaseIDPreparerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseIDPreparer().(ctx, accountName, containerName, leaseID, level) |
| 28 | if err != nil { |
| 29 | err = autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.NewErrorWithErrorscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/NewErrorWithError().(err, "containers.Client", "SetAccessControl", nil, "Failure preparing request") |
| 30 | return |
| 31 | } |
| 32 | |
| 33 | resp, err := client.SetAccessControlWithLeaseIDSenderscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseIDSender().(req) |
| 34 | if err != nil { |
| 35 | result = autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Responsescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Response#{Responsescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Response#Response.: resp} |
| 36 | err = autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.NewErrorWithErrorscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/NewErrorWithError().(err, "containers.Client", "SetAccessControl", resp, "Failure sending request") |
| 37 | return |
| 38 | } |
| 39 | |
| 40 | result, err = client.SetAccessControlWithLeaseIDResponderscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseIDResponder().(resp) |
| 41 | if err != nil { |
| 42 | err = autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.NewErrorWithErrorscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/NewErrorWithError().(err, "containers.Client", "SetAccessControl", resp, "Failure responding to request") |
| 43 | return |
| 44 | } |
| 45 | |
| 46 | return |
| 47 | } |
| 48 | |
| 49 | // SetAccessControlWithLeaseIDPreparer prepares the SetAccessControlWithLeaseID request. |
| 50 | func (client Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#) SetAccessControlWithLeaseIDPreparerscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseIDPreparer().(ctx contextscip-go gomod github.com/golang/go/src go1.13 context/.Contextscip-go gomod github.com/golang/go/src go1.13 context/Context#, accountName, containerName, leaseID string, level AccessLevelscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/AccessLevel#) (*httpscip-go gomod github.com/golang/go/src go1.13 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.13 `net/http`/Request#, error) { |
| 51 | pathParameters := map[string]interface{}{ |
| 52 | "containerName": autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Encodescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Encode().("path", containerName), |
| 53 | } |
| 54 | |
| 55 | queryParameters := map[string]interface{}{ |
| 56 | "comp": autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Encodescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Encode().("path", "acl"), |
| 57 | "restype": autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Encodescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Encode().("path", "container"), |
| 58 | } |
| 59 | |
| 60 | headers := map[string]interface{}{ |
| 61 | "x-ms-version": APIVersionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/APIVersion., |
| 62 | } |
| 63 | |
| 64 | headers = client.setAccessLevelIntoHeadersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#setAccessLevelIntoHeaders().(headers, level) |
| 65 | |
| 66 | // If specified, Get Container Properties only succeeds if the container’s lease is active and matches this ID. |
| 67 | // If there is no active lease or the ID does not match, 412 (Precondition Failed) is returned. |
| 68 | if leaseID != "" { |
| 69 | headers["x-ms-lease-id"] = leaseID |
| 70 | } |
| 71 | |
| 72 | preparer := autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.CreatePreparerscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/CreatePreparer().( |
| 73 | autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.AsContentTypescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/AsContentType().("application/xml; charset=utf-8"), |
| 74 | autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.AsPutscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/AsPut().(), |
| 75 | autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.WithBaseURLscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/WithBaseURL().(endpointsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/.GetBlobEndpointscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/internal/endpoints`/GetBlobEndpoint().(client.BaseURIscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#BaseURI., accountName)), |
| 76 | autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.WithPathParametersscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/WithPathParameters().("/{containerName}", pathParameters), |
| 77 | autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.WithQueryParametersscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/WithQueryParameters().(queryParameters), |
| 78 | autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.WithHeadersscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/WithHeaders().(headers)) |
| 79 | return preparer.Preparescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Preparer#Prepare().((&httpscip-go gomod github.com/golang/go/src go1.13 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.13 `net/http`/Request#{}).WithContextscip-go gomod github.com/golang/go/src go1.13 `net/http`/Request#WithContext().(ctx)) |
| 80 | } |
| 81 | |
| 82 | // SetAccessControlWithLeaseIDSender sends the SetAccessControlWithLeaseID request. The method will close the |
| 83 | // http.Response Body if it receives an error. |
| 84 | func (client Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#) SetAccessControlWithLeaseIDSenderscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseIDSender().(req *httpscip-go gomod github.com/golang/go/src go1.13 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.13 `net/http`/Request#) (*httpscip-go gomod github.com/golang/go/src go1.13 `net/http`/.Responsescip-go gomod github.com/golang/go/src go1.13 `net/http`/Response#, error) { |
| 85 | return autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.SendWithSenderscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/SendWithSender().(client, req, |
| 86 | azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.DoRetryWithRegistrationscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/DoRetryWithRegistration().(client.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#Client.)) |
| 87 | } |
| 88 | |
| 89 | // SetAccessControlWithLeaseIDResponder handles the response to the SetAccessControlWithLeaseID request. The method always |
| 90 | // closes the http.Response Body. |
| 91 | func (client Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#) SetAccessControlWithLeaseIDResponderscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/blob/containers`/Client#SetAccessControlWithLeaseIDResponder().(resp *httpscip-go gomod github.com/golang/go/src go1.13 `net/http`/.Responsescip-go gomod github.com/golang/go/src go1.13 `net/http`/Response#) (result autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Responsescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Response#, err error) { |
| 92 | err = autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Respondscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Respond().( |
| 93 | resp, |
| 94 | client.ByInspectingscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Client#ByInspecting().(), |
| 95 | azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.WithErrorUnlessStatusCodescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/WithErrorUnlessStatusCode().(httpscip-go gomod github.com/golang/go/src go1.13 `net/http`/.StatusOKscip-go gomod github.com/golang/go/src go1.13 `net/http`/StatusOK.), |
| 96 | autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.ByClosingscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/ByClosing().()) |
| 97 | result = autorestscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/.Responsescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Response#{Responsescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest`/Response#Response.: resp} |
| 98 | |
| 99 | return |
| 100 | } |