1package media 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/validation" 25 "github.com/Azure/go-autorest/tracing" 26 "net/http" 27) 28 29// StreamingLocatorsClient is the client for the StreamingLocators methods of the Media service. 30type StreamingLocatorsClient struct { 31 BaseClient 32} 33 34// NewStreamingLocatorsClient creates an instance of the StreamingLocatorsClient client. 35func NewStreamingLocatorsClient(subscriptionID string) StreamingLocatorsClient { 36 return NewStreamingLocatorsClientWithBaseURI(DefaultBaseURI, subscriptionID) 37} 38 39// NewStreamingLocatorsClientWithBaseURI creates an instance of the StreamingLocatorsClient client. 40func NewStreamingLocatorsClientWithBaseURI(baseURI string, subscriptionID string) StreamingLocatorsClient { 41 return StreamingLocatorsClient{NewWithBaseURI(baseURI, subscriptionID)} 42} 43 44// Create create a Streaming Locator in the Media Services account 45// Parameters: 46// resourceGroupName - the name of the resource group within the Azure subscription. 47// accountName - the Media Services account name. 48// streamingLocatorName - the Streaming Locator name. 49// parameters - the request parameters 50func (client StreamingLocatorsClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, parameters StreamingLocator) (result StreamingLocator, err error) { 51 if tracing.IsEnabled() { 52 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorsClient.Create") 53 defer func() { 54 sc := -1 55 if result.Response.Response != nil { 56 sc = result.Response.Response.StatusCode 57 } 58 tracing.EndSpan(ctx, sc, err) 59 }() 60 } 61 if err := validation.Validate([]validation.Validation{ 62 {TargetValue: parameters, 63 Constraints: []validation.Constraint{{Target: "parameters.StreamingLocatorProperties", Name: validation.Null, Rule: false, 64 Chain: []validation.Constraint{{Target: "parameters.StreamingLocatorProperties.AssetName", Name: validation.Null, Rule: true, Chain: nil}, 65 {Target: "parameters.StreamingLocatorProperties.StreamingPolicyName", Name: validation.Null, Rule: true, Chain: nil}, 66 }}}}}); err != nil { 67 return result, validation.NewError("media.StreamingLocatorsClient", "Create", err.Error()) 68 } 69 70 req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, streamingLocatorName, parameters) 71 if err != nil { 72 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Create", nil, "Failure preparing request") 73 return 74 } 75 76 resp, err := client.CreateSender(req) 77 if err != nil { 78 result.Response = autorest.Response{Response: resp} 79 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Create", resp, "Failure sending request") 80 return 81 } 82 83 result, err = client.CreateResponder(resp) 84 if err != nil { 85 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Create", resp, "Failure responding to request") 86 } 87 88 return 89} 90 91// CreatePreparer prepares the Create request. 92func (client StreamingLocatorsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, parameters StreamingLocator) (*http.Request, error) { 93 pathParameters := map[string]interface{}{ 94 "accountName": autorest.Encode("path", accountName), 95 "resourceGroupName": autorest.Encode("path", resourceGroupName), 96 "streamingLocatorName": autorest.Encode("path", streamingLocatorName), 97 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 98 } 99 100 const APIVersion = "2018-03-30-preview" 101 queryParameters := map[string]interface{}{ 102 "api-version": APIVersion, 103 } 104 105 preparer := autorest.CreatePreparer( 106 autorest.AsContentType("application/json; charset=utf-8"), 107 autorest.AsPut(), 108 autorest.WithBaseURL(client.BaseURI), 109 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", pathParameters), 110 autorest.WithJSON(parameters), 111 autorest.WithQueryParameters(queryParameters)) 112 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 113} 114 115// CreateSender sends the Create request. The method will close the 116// http.Response Body if it receives an error. 117func (client StreamingLocatorsClient) CreateSender(req *http.Request) (*http.Response, error) { 118 sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) 119 return autorest.SendWithSender(client, req, sd...) 120} 121 122// CreateResponder handles the response to the Create request. The method always 123// closes the http.Response Body. 124func (client StreamingLocatorsClient) CreateResponder(resp *http.Response) (result StreamingLocator, err error) { 125 err = autorest.Respond( 126 resp, 127 client.ByInspecting(), 128 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 129 autorest.ByUnmarshallingJSON(&result), 130 autorest.ByClosing()) 131 result.Response = autorest.Response{Response: resp} 132 return 133} 134 135// Delete deletes a Streaming Locator in the Media Services account 136// Parameters: 137// resourceGroupName - the name of the resource group within the Azure subscription. 138// accountName - the Media Services account name. 139// streamingLocatorName - the Streaming Locator name. 140func (client StreamingLocatorsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result autorest.Response, err error) { 141 if tracing.IsEnabled() { 142 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorsClient.Delete") 143 defer func() { 144 sc := -1 145 if result.Response != nil { 146 sc = result.Response.StatusCode 147 } 148 tracing.EndSpan(ctx, sc, err) 149 }() 150 } 151 req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, streamingLocatorName) 152 if err != nil { 153 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Delete", nil, "Failure preparing request") 154 return 155 } 156 157 resp, err := client.DeleteSender(req) 158 if err != nil { 159 result.Response = resp 160 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Delete", resp, "Failure sending request") 161 return 162 } 163 164 result, err = client.DeleteResponder(resp) 165 if err != nil { 166 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Delete", resp, "Failure responding to request") 167 } 168 169 return 170} 171 172// DeletePreparer prepares the Delete request. 173func (client StreamingLocatorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { 174 pathParameters := map[string]interface{}{ 175 "accountName": autorest.Encode("path", accountName), 176 "resourceGroupName": autorest.Encode("path", resourceGroupName), 177 "streamingLocatorName": autorest.Encode("path", streamingLocatorName), 178 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 179 } 180 181 const APIVersion = "2018-03-30-preview" 182 queryParameters := map[string]interface{}{ 183 "api-version": APIVersion, 184 } 185 186 preparer := autorest.CreatePreparer( 187 autorest.AsDelete(), 188 autorest.WithBaseURL(client.BaseURI), 189 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", pathParameters), 190 autorest.WithQueryParameters(queryParameters)) 191 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 192} 193 194// DeleteSender sends the Delete request. The method will close the 195// http.Response Body if it receives an error. 196func (client StreamingLocatorsClient) DeleteSender(req *http.Request) (*http.Response, error) { 197 sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) 198 return autorest.SendWithSender(client, req, sd...) 199} 200 201// DeleteResponder handles the response to the Delete request. The method always 202// closes the http.Response Body. 203func (client StreamingLocatorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 204 err = autorest.Respond( 205 resp, 206 client.ByInspecting(), 207 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 208 autorest.ByClosing()) 209 result.Response = resp 210 return 211} 212 213// Get get the details of a Streaming Locator in the Media Services account 214// Parameters: 215// resourceGroupName - the name of the resource group within the Azure subscription. 216// accountName - the Media Services account name. 217// streamingLocatorName - the Streaming Locator name. 218func (client StreamingLocatorsClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result StreamingLocator, err error) { 219 if tracing.IsEnabled() { 220 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorsClient.Get") 221 defer func() { 222 sc := -1 223 if result.Response.Response != nil { 224 sc = result.Response.Response.StatusCode 225 } 226 tracing.EndSpan(ctx, sc, err) 227 }() 228 } 229 req, err := client.GetPreparer(ctx, resourceGroupName, accountName, streamingLocatorName) 230 if err != nil { 231 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Get", nil, "Failure preparing request") 232 return 233 } 234 235 resp, err := client.GetSender(req) 236 if err != nil { 237 result.Response = autorest.Response{Response: resp} 238 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Get", resp, "Failure sending request") 239 return 240 } 241 242 result, err = client.GetResponder(resp) 243 if err != nil { 244 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "Get", resp, "Failure responding to request") 245 } 246 247 return 248} 249 250// GetPreparer prepares the Get request. 251func (client StreamingLocatorsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { 252 pathParameters := map[string]interface{}{ 253 "accountName": autorest.Encode("path", accountName), 254 "resourceGroupName": autorest.Encode("path", resourceGroupName), 255 "streamingLocatorName": autorest.Encode("path", streamingLocatorName), 256 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 257 } 258 259 const APIVersion = "2018-03-30-preview" 260 queryParameters := map[string]interface{}{ 261 "api-version": APIVersion, 262 } 263 264 preparer := autorest.CreatePreparer( 265 autorest.AsGet(), 266 autorest.WithBaseURL(client.BaseURI), 267 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}", pathParameters), 268 autorest.WithQueryParameters(queryParameters)) 269 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 270} 271 272// GetSender sends the Get request. The method will close the 273// http.Response Body if it receives an error. 274func (client StreamingLocatorsClient) GetSender(req *http.Request) (*http.Response, error) { 275 sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) 276 return autorest.SendWithSender(client, req, sd...) 277} 278 279// GetResponder handles the response to the Get request. The method always 280// closes the http.Response Body. 281func (client StreamingLocatorsClient) GetResponder(resp *http.Response) (result StreamingLocator, err error) { 282 err = autorest.Respond( 283 resp, 284 client.ByInspecting(), 285 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), 286 autorest.ByUnmarshallingJSON(&result), 287 autorest.ByClosing()) 288 result.Response = autorest.Response{Response: resp} 289 return 290} 291 292// List lists the Streaming Locators in the account 293// Parameters: 294// resourceGroupName - the name of the resource group within the Azure subscription. 295// accountName - the Media Services account name. 296// filter - restricts the set of items returned. 297// top - specifies a non-negative integer n that limits the number of items returned from a collection. The 298// service returns the number of available items up to but not greater than the specified value n. 299// orderby - specifies the key by which the result collection should be ordered. 300func (client StreamingLocatorsClient) List(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result StreamingLocatorCollectionPage, err error) { 301 if tracing.IsEnabled() { 302 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorsClient.List") 303 defer func() { 304 sc := -1 305 if result.slc.Response.Response != nil { 306 sc = result.slc.Response.Response.StatusCode 307 } 308 tracing.EndSpan(ctx, sc, err) 309 }() 310 } 311 result.fn = client.listNextResults 312 req, err := client.ListPreparer(ctx, resourceGroupName, accountName, filter, top, orderby) 313 if err != nil { 314 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "List", nil, "Failure preparing request") 315 return 316 } 317 318 resp, err := client.ListSender(req) 319 if err != nil { 320 result.slc.Response = autorest.Response{Response: resp} 321 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "List", resp, "Failure sending request") 322 return 323 } 324 325 result.slc, err = client.ListResponder(resp) 326 if err != nil { 327 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "List", resp, "Failure responding to request") 328 } 329 330 return 331} 332 333// ListPreparer prepares the List request. 334func (client StreamingLocatorsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (*http.Request, error) { 335 pathParameters := map[string]interface{}{ 336 "accountName": autorest.Encode("path", accountName), 337 "resourceGroupName": autorest.Encode("path", resourceGroupName), 338 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 339 } 340 341 const APIVersion = "2018-03-30-preview" 342 queryParameters := map[string]interface{}{ 343 "api-version": APIVersion, 344 } 345 if len(filter) > 0 { 346 queryParameters["$filter"] = autorest.Encode("query", filter) 347 } 348 if top != nil { 349 queryParameters["$top"] = autorest.Encode("query", *top) 350 } 351 if len(orderby) > 0 { 352 queryParameters["$orderby"] = autorest.Encode("query", orderby) 353 } 354 355 preparer := autorest.CreatePreparer( 356 autorest.AsGet(), 357 autorest.WithBaseURL(client.BaseURI), 358 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators", pathParameters), 359 autorest.WithQueryParameters(queryParameters)) 360 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 361} 362 363// ListSender sends the List request. The method will close the 364// http.Response Body if it receives an error. 365func (client StreamingLocatorsClient) ListSender(req *http.Request) (*http.Response, error) { 366 sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) 367 return autorest.SendWithSender(client, req, sd...) 368} 369 370// ListResponder handles the response to the List request. The method always 371// closes the http.Response Body. 372func (client StreamingLocatorsClient) ListResponder(resp *http.Response) (result StreamingLocatorCollection, err error) { 373 err = autorest.Respond( 374 resp, 375 client.ByInspecting(), 376 azure.WithErrorUnlessStatusCode(http.StatusOK), 377 autorest.ByUnmarshallingJSON(&result), 378 autorest.ByClosing()) 379 result.Response = autorest.Response{Response: resp} 380 return 381} 382 383// listNextResults retrieves the next set of results, if any. 384func (client StreamingLocatorsClient) listNextResults(ctx context.Context, lastResults StreamingLocatorCollection) (result StreamingLocatorCollection, err error) { 385 req, err := lastResults.streamingLocatorCollectionPreparer(ctx) 386 if err != nil { 387 return result, autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "listNextResults", nil, "Failure preparing next results request") 388 } 389 if req == nil { 390 return 391 } 392 resp, err := client.ListSender(req) 393 if err != nil { 394 result.Response = autorest.Response{Response: resp} 395 return result, autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "listNextResults", resp, "Failure sending next results request") 396 } 397 result, err = client.ListResponder(resp) 398 if err != nil { 399 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "listNextResults", resp, "Failure responding to next results request") 400 } 401 return 402} 403 404// ListComplete enumerates all values, automatically crossing page boundaries as required. 405func (client StreamingLocatorsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, orderby string) (result StreamingLocatorCollectionIterator, err error) { 406 if tracing.IsEnabled() { 407 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorsClient.List") 408 defer func() { 409 sc := -1 410 if result.Response().Response.Response != nil { 411 sc = result.page.Response().Response.Response.StatusCode 412 } 413 tracing.EndSpan(ctx, sc, err) 414 }() 415 } 416 result.page, err = client.List(ctx, resourceGroupName, accountName, filter, top, orderby) 417 return 418} 419 420// ListContentKeys list Content Keys used by this Streaming Locator 421// Parameters: 422// resourceGroupName - the name of the resource group within the Azure subscription. 423// accountName - the Media Services account name. 424// streamingLocatorName - the Streaming Locator name. 425func (client StreamingLocatorsClient) ListContentKeys(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result ListContentKeysResponse, err error) { 426 if tracing.IsEnabled() { 427 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorsClient.ListContentKeys") 428 defer func() { 429 sc := -1 430 if result.Response.Response != nil { 431 sc = result.Response.Response.StatusCode 432 } 433 tracing.EndSpan(ctx, sc, err) 434 }() 435 } 436 req, err := client.ListContentKeysPreparer(ctx, resourceGroupName, accountName, streamingLocatorName) 437 if err != nil { 438 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListContentKeys", nil, "Failure preparing request") 439 return 440 } 441 442 resp, err := client.ListContentKeysSender(req) 443 if err != nil { 444 result.Response = autorest.Response{Response: resp} 445 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListContentKeys", resp, "Failure sending request") 446 return 447 } 448 449 result, err = client.ListContentKeysResponder(resp) 450 if err != nil { 451 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListContentKeys", resp, "Failure responding to request") 452 } 453 454 return 455} 456 457// ListContentKeysPreparer prepares the ListContentKeys request. 458func (client StreamingLocatorsClient) ListContentKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { 459 pathParameters := map[string]interface{}{ 460 "accountName": autorest.Encode("path", accountName), 461 "resourceGroupName": autorest.Encode("path", resourceGroupName), 462 "streamingLocatorName": autorest.Encode("path", streamingLocatorName), 463 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 464 } 465 466 const APIVersion = "2018-03-30-preview" 467 queryParameters := map[string]interface{}{ 468 "api-version": APIVersion, 469 } 470 471 preparer := autorest.CreatePreparer( 472 autorest.AsPost(), 473 autorest.WithBaseURL(client.BaseURI), 474 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listContentKeys", pathParameters), 475 autorest.WithQueryParameters(queryParameters)) 476 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 477} 478 479// ListContentKeysSender sends the ListContentKeys request. The method will close the 480// http.Response Body if it receives an error. 481func (client StreamingLocatorsClient) ListContentKeysSender(req *http.Request) (*http.Response, error) { 482 sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) 483 return autorest.SendWithSender(client, req, sd...) 484} 485 486// ListContentKeysResponder handles the response to the ListContentKeys request. The method always 487// closes the http.Response Body. 488func (client StreamingLocatorsClient) ListContentKeysResponder(resp *http.Response) (result ListContentKeysResponse, err error) { 489 err = autorest.Respond( 490 resp, 491 client.ByInspecting(), 492 azure.WithErrorUnlessStatusCode(http.StatusOK), 493 autorest.ByUnmarshallingJSON(&result), 494 autorest.ByClosing()) 495 result.Response = autorest.Response{Response: resp} 496 return 497} 498 499// ListPaths list Paths supported by this Streaming Locator 500// Parameters: 501// resourceGroupName - the name of the resource group within the Azure subscription. 502// accountName - the Media Services account name. 503// streamingLocatorName - the Streaming Locator name. 504func (client StreamingLocatorsClient) ListPaths(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (result ListPathsResponse, err error) { 505 if tracing.IsEnabled() { 506 ctx = tracing.StartSpan(ctx, fqdn+"/StreamingLocatorsClient.ListPaths") 507 defer func() { 508 sc := -1 509 if result.Response.Response != nil { 510 sc = result.Response.Response.StatusCode 511 } 512 tracing.EndSpan(ctx, sc, err) 513 }() 514 } 515 req, err := client.ListPathsPreparer(ctx, resourceGroupName, accountName, streamingLocatorName) 516 if err != nil { 517 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListPaths", nil, "Failure preparing request") 518 return 519 } 520 521 resp, err := client.ListPathsSender(req) 522 if err != nil { 523 result.Response = autorest.Response{Response: resp} 524 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListPaths", resp, "Failure sending request") 525 return 526 } 527 528 result, err = client.ListPathsResponder(resp) 529 if err != nil { 530 err = autorest.NewErrorWithError(err, "media.StreamingLocatorsClient", "ListPaths", resp, "Failure responding to request") 531 } 532 533 return 534} 535 536// ListPathsPreparer prepares the ListPaths request. 537func (client StreamingLocatorsClient) ListPathsPreparer(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string) (*http.Request, error) { 538 pathParameters := map[string]interface{}{ 539 "accountName": autorest.Encode("path", accountName), 540 "resourceGroupName": autorest.Encode("path", resourceGroupName), 541 "streamingLocatorName": autorest.Encode("path", streamingLocatorName), 542 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 543 } 544 545 const APIVersion = "2018-03-30-preview" 546 queryParameters := map[string]interface{}{ 547 "api-version": APIVersion, 548 } 549 550 preparer := autorest.CreatePreparer( 551 autorest.AsPost(), 552 autorest.WithBaseURL(client.BaseURI), 553 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/streamingLocators/{streamingLocatorName}/listPaths", pathParameters), 554 autorest.WithQueryParameters(queryParameters)) 555 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 556} 557 558// ListPathsSender sends the ListPaths request. The method will close the 559// http.Response Body if it receives an error. 560func (client StreamingLocatorsClient) ListPathsSender(req *http.Request) (*http.Response, error) { 561 sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) 562 return autorest.SendWithSender(client, req, sd...) 563} 564 565// ListPathsResponder handles the response to the ListPaths request. The method always 566// closes the http.Response Body. 567func (client StreamingLocatorsClient) ListPathsResponder(resp *http.Response) (result ListPathsResponse, err error) { 568 err = autorest.Respond( 569 resp, 570 client.ByInspecting(), 571 azure.WithErrorUnlessStatusCode(http.StatusOK), 572 autorest.ByUnmarshallingJSON(&result), 573 autorest.ByClosing()) 574 result.Response = autorest.Response{Response: resp} 575 return 576} 577