1package sql 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 "net/http" 25) 26 27// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 28// SyncMembersClient is the the Azure SQL Database management API provides a RESTful set of web services that interact 29// with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and 30// delete databases. 31type SyncMembersClient struct { 32 BaseClient 33} 34 35// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 36// NewSyncMembersClient creates an instance of the SyncMembersClient client. 37func NewSyncMembersClient(subscriptionID string) SyncMembersClient { 38 return NewSyncMembersClientWithBaseURI(DefaultBaseURI, subscriptionID) 39} 40 41// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 42// NewSyncMembersClientWithBaseURI creates an instance of the SyncMembersClient client. 43func NewSyncMembersClientWithBaseURI(baseURI string, subscriptionID string) SyncMembersClient { 44 return SyncMembersClient{NewWithBaseURI(baseURI, subscriptionID)} 45} 46 47// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 48// CreateOrUpdate creates or updates a sync member. 49// 50// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from 51// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of 52// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync 53// member is hosted. syncMemberName is the name of the sync member. parameters is the requested sync member 54// resource state. 55func (client SyncMembersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (result SyncMembersCreateOrUpdateFuture, err error) { 56 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters) 57 if err != nil { 58 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "CreateOrUpdate", nil, "Failure preparing request") 59 return 60 } 61 62 result, err = client.CreateOrUpdateSender(req) 63 if err != nil { 64 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "CreateOrUpdate", result.Response(), "Failure sending request") 65 return 66 } 67 68 return 69} 70 71// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 72// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 73func (client SyncMembersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (*http.Request, error) { 74 pathParameters := map[string]interface{}{ 75 "databaseName": autorest.Encode("path", databaseName), 76 "resourceGroupName": autorest.Encode("path", resourceGroupName), 77 "serverName": autorest.Encode("path", serverName), 78 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 79 "syncGroupName": autorest.Encode("path", syncGroupName), 80 "syncMemberName": autorest.Encode("path", syncMemberName), 81 } 82 83 const APIVersion = "2015-05-01-preview" 84 queryParameters := map[string]interface{}{ 85 "api-version": APIVersion, 86 } 87 88 preparer := autorest.CreatePreparer( 89 autorest.AsContentType("application/json; charset=utf-8"), 90 autorest.AsPut(), 91 autorest.WithBaseURL(client.BaseURI), 92 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", pathParameters), 93 autorest.WithJSON(parameters), 94 autorest.WithQueryParameters(queryParameters)) 95 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 96} 97 98// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 99// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 100// http.Response Body if it receives an error. 101func (client SyncMembersClient) CreateOrUpdateSender(req *http.Request) (future SyncMembersCreateOrUpdateFuture, err error) { 102 sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) 103 future.Future = azure.NewFuture(req) 104 future.req = req 105 _, err = future.Done(sender) 106 if err != nil { 107 return 108 } 109 err = autorest.Respond(future.Response(), 110 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) 111 return 112} 113 114// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 115// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 116// closes the http.Response Body. 117func (client SyncMembersClient) CreateOrUpdateResponder(resp *http.Response) (result SyncMember, err error) { 118 err = autorest.Respond( 119 resp, 120 client.ByInspecting(), 121 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), 122 autorest.ByUnmarshallingJSON(&result), 123 autorest.ByClosing()) 124 result.Response = autorest.Response{Response: resp} 125 return 126} 127 128// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 129// Delete deletes a sync member. 130// 131// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from 132// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of 133// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync 134// member is hosted. syncMemberName is the name of the sync member. 135func (client SyncMembersClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMembersDeleteFuture, err error) { 136 req, err := client.DeletePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) 137 if err != nil { 138 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Delete", nil, "Failure preparing request") 139 return 140 } 141 142 result, err = client.DeleteSender(req) 143 if err != nil { 144 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Delete", result.Response(), "Failure sending request") 145 return 146 } 147 148 return 149} 150 151// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 152// DeletePreparer prepares the Delete request. 153func (client SyncMembersClient) DeletePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (*http.Request, error) { 154 pathParameters := map[string]interface{}{ 155 "databaseName": autorest.Encode("path", databaseName), 156 "resourceGroupName": autorest.Encode("path", resourceGroupName), 157 "serverName": autorest.Encode("path", serverName), 158 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 159 "syncGroupName": autorest.Encode("path", syncGroupName), 160 "syncMemberName": autorest.Encode("path", syncMemberName), 161 } 162 163 const APIVersion = "2015-05-01-preview" 164 queryParameters := map[string]interface{}{ 165 "api-version": APIVersion, 166 } 167 168 preparer := autorest.CreatePreparer( 169 autorest.AsDelete(), 170 autorest.WithBaseURL(client.BaseURI), 171 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", pathParameters), 172 autorest.WithQueryParameters(queryParameters)) 173 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 174} 175 176// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 177// DeleteSender sends the Delete request. The method will close the 178// http.Response Body if it receives an error. 179func (client SyncMembersClient) DeleteSender(req *http.Request) (future SyncMembersDeleteFuture, err error) { 180 sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) 181 future.Future = azure.NewFuture(req) 182 future.req = req 183 _, err = future.Done(sender) 184 if err != nil { 185 return 186 } 187 err = autorest.Respond(future.Response(), 188 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) 189 return 190} 191 192// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 193// DeleteResponder handles the response to the Delete request. The method always 194// closes the http.Response Body. 195func (client SyncMembersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 196 err = autorest.Respond( 197 resp, 198 client.ByInspecting(), 199 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 200 autorest.ByClosing()) 201 result.Response = resp 202 return 203} 204 205// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 206// Get gets a sync member. 207// 208// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from 209// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of 210// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync 211// member is hosted. syncMemberName is the name of the sync member. 212func (client SyncMembersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMember, err error) { 213 req, err := client.GetPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) 214 if err != nil { 215 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Get", nil, "Failure preparing request") 216 return 217 } 218 219 resp, err := client.GetSender(req) 220 if err != nil { 221 result.Response = autorest.Response{Response: resp} 222 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Get", resp, "Failure sending request") 223 return 224 } 225 226 result, err = client.GetResponder(resp) 227 if err != nil { 228 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Get", resp, "Failure responding to request") 229 } 230 231 return 232} 233 234// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 235// GetPreparer prepares the Get request. 236func (client SyncMembersClient) GetPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (*http.Request, error) { 237 pathParameters := map[string]interface{}{ 238 "databaseName": autorest.Encode("path", databaseName), 239 "resourceGroupName": autorest.Encode("path", resourceGroupName), 240 "serverName": autorest.Encode("path", serverName), 241 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 242 "syncGroupName": autorest.Encode("path", syncGroupName), 243 "syncMemberName": autorest.Encode("path", syncMemberName), 244 } 245 246 const APIVersion = "2015-05-01-preview" 247 queryParameters := map[string]interface{}{ 248 "api-version": APIVersion, 249 } 250 251 preparer := autorest.CreatePreparer( 252 autorest.AsGet(), 253 autorest.WithBaseURL(client.BaseURI), 254 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", pathParameters), 255 autorest.WithQueryParameters(queryParameters)) 256 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 257} 258 259// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 260// GetSender sends the Get request. The method will close the 261// http.Response Body if it receives an error. 262func (client SyncMembersClient) GetSender(req *http.Request) (*http.Response, error) { 263 return autorest.SendWithSender(client, req, 264 azure.DoRetryWithRegistration(client.Client)) 265} 266 267// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 268// GetResponder handles the response to the Get request. The method always 269// closes the http.Response Body. 270func (client SyncMembersClient) GetResponder(resp *http.Response) (result SyncMember, err error) { 271 err = autorest.Respond( 272 resp, 273 client.ByInspecting(), 274 azure.WithErrorUnlessStatusCode(http.StatusOK), 275 autorest.ByUnmarshallingJSON(&result), 276 autorest.ByClosing()) 277 result.Response = autorest.Response{Response: resp} 278 return 279} 280 281// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 282// ListBySyncGroup lists sync members in the given sync group. 283// 284// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from 285// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of 286// the database on which the sync group is hosted. syncGroupName is the name of the sync group. 287func (client SyncMembersClient) ListBySyncGroup(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncMemberListResultPage, err error) { 288 result.fn = client.listBySyncGroupNextResults 289 req, err := client.ListBySyncGroupPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName) 290 if err != nil { 291 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListBySyncGroup", nil, "Failure preparing request") 292 return 293 } 294 295 resp, err := client.ListBySyncGroupSender(req) 296 if err != nil { 297 result.smlr.Response = autorest.Response{Response: resp} 298 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListBySyncGroup", resp, "Failure sending request") 299 return 300 } 301 302 result.smlr, err = client.ListBySyncGroupResponder(resp) 303 if err != nil { 304 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListBySyncGroup", resp, "Failure responding to request") 305 } 306 307 return 308} 309 310// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 311// ListBySyncGroupPreparer prepares the ListBySyncGroup request. 312func (client SyncMembersClient) ListBySyncGroupPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (*http.Request, error) { 313 pathParameters := map[string]interface{}{ 314 "databaseName": autorest.Encode("path", databaseName), 315 "resourceGroupName": autorest.Encode("path", resourceGroupName), 316 "serverName": autorest.Encode("path", serverName), 317 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 318 "syncGroupName": autorest.Encode("path", syncGroupName), 319 } 320 321 const APIVersion = "2015-05-01-preview" 322 queryParameters := map[string]interface{}{ 323 "api-version": APIVersion, 324 } 325 326 preparer := autorest.CreatePreparer( 327 autorest.AsGet(), 328 autorest.WithBaseURL(client.BaseURI), 329 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers", pathParameters), 330 autorest.WithQueryParameters(queryParameters)) 331 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 332} 333 334// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 335// ListBySyncGroupSender sends the ListBySyncGroup request. The method will close the 336// http.Response Body if it receives an error. 337func (client SyncMembersClient) ListBySyncGroupSender(req *http.Request) (*http.Response, error) { 338 return autorest.SendWithSender(client, req, 339 azure.DoRetryWithRegistration(client.Client)) 340} 341 342// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 343// ListBySyncGroupResponder handles the response to the ListBySyncGroup request. The method always 344// closes the http.Response Body. 345func (client SyncMembersClient) ListBySyncGroupResponder(resp *http.Response) (result SyncMemberListResult, err error) { 346 err = autorest.Respond( 347 resp, 348 client.ByInspecting(), 349 azure.WithErrorUnlessStatusCode(http.StatusOK), 350 autorest.ByUnmarshallingJSON(&result), 351 autorest.ByClosing()) 352 result.Response = autorest.Response{Response: resp} 353 return 354} 355 356// listBySyncGroupNextResults retrieves the next set of results, if any. 357func (client SyncMembersClient) listBySyncGroupNextResults(lastResults SyncMemberListResult) (result SyncMemberListResult, err error) { 358 req, err := lastResults.syncMemberListResultPreparer() 359 if err != nil { 360 return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listBySyncGroupNextResults", nil, "Failure preparing next results request") 361 } 362 if req == nil { 363 return 364 } 365 resp, err := client.ListBySyncGroupSender(req) 366 if err != nil { 367 result.Response = autorest.Response{Response: resp} 368 return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listBySyncGroupNextResults", resp, "Failure sending next results request") 369 } 370 result, err = client.ListBySyncGroupResponder(resp) 371 if err != nil { 372 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listBySyncGroupNextResults", resp, "Failure responding to next results request") 373 } 374 return 375} 376 377// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 378// ListBySyncGroupComplete enumerates all values, automatically crossing page boundaries as required. 379func (client SyncMembersClient) ListBySyncGroupComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result SyncMemberListResultIterator, err error) { 380 result.page, err = client.ListBySyncGroup(ctx, resourceGroupName, serverName, databaseName, syncGroupName) 381 return 382} 383 384// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 385// ListMemberSchemas gets a sync member database schema. 386// 387// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from 388// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of 389// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync 390// member is hosted. syncMemberName is the name of the sync member. 391func (client SyncMembersClient) ListMemberSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncFullSchemaPropertiesListResultPage, err error) { 392 result.fn = client.listMemberSchemasNextResults 393 req, err := client.ListMemberSchemasPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) 394 if err != nil { 395 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListMemberSchemas", nil, "Failure preparing request") 396 return 397 } 398 399 resp, err := client.ListMemberSchemasSender(req) 400 if err != nil { 401 result.sfsplr.Response = autorest.Response{Response: resp} 402 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListMemberSchemas", resp, "Failure sending request") 403 return 404 } 405 406 result.sfsplr, err = client.ListMemberSchemasResponder(resp) 407 if err != nil { 408 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "ListMemberSchemas", resp, "Failure responding to request") 409 } 410 411 return 412} 413 414// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 415// ListMemberSchemasPreparer prepares the ListMemberSchemas request. 416func (client SyncMembersClient) ListMemberSchemasPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (*http.Request, error) { 417 pathParameters := map[string]interface{}{ 418 "databaseName": autorest.Encode("path", databaseName), 419 "resourceGroupName": autorest.Encode("path", resourceGroupName), 420 "serverName": autorest.Encode("path", serverName), 421 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 422 "syncGroupName": autorest.Encode("path", syncGroupName), 423 "syncMemberName": autorest.Encode("path", syncMemberName), 424 } 425 426 const APIVersion = "2015-05-01-preview" 427 queryParameters := map[string]interface{}{ 428 "api-version": APIVersion, 429 } 430 431 preparer := autorest.CreatePreparer( 432 autorest.AsGet(), 433 autorest.WithBaseURL(client.BaseURI), 434 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas", pathParameters), 435 autorest.WithQueryParameters(queryParameters)) 436 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 437} 438 439// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 440// ListMemberSchemasSender sends the ListMemberSchemas request. The method will close the 441// http.Response Body if it receives an error. 442func (client SyncMembersClient) ListMemberSchemasSender(req *http.Request) (*http.Response, error) { 443 return autorest.SendWithSender(client, req, 444 azure.DoRetryWithRegistration(client.Client)) 445} 446 447// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 448// ListMemberSchemasResponder handles the response to the ListMemberSchemas request. The method always 449// closes the http.Response Body. 450func (client SyncMembersClient) ListMemberSchemasResponder(resp *http.Response) (result SyncFullSchemaPropertiesListResult, err error) { 451 err = autorest.Respond( 452 resp, 453 client.ByInspecting(), 454 azure.WithErrorUnlessStatusCode(http.StatusOK), 455 autorest.ByUnmarshallingJSON(&result), 456 autorest.ByClosing()) 457 result.Response = autorest.Response{Response: resp} 458 return 459} 460 461// listMemberSchemasNextResults retrieves the next set of results, if any. 462func (client SyncMembersClient) listMemberSchemasNextResults(lastResults SyncFullSchemaPropertiesListResult) (result SyncFullSchemaPropertiesListResult, err error) { 463 req, err := lastResults.syncFullSchemaPropertiesListResultPreparer() 464 if err != nil { 465 return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listMemberSchemasNextResults", nil, "Failure preparing next results request") 466 } 467 if req == nil { 468 return 469 } 470 resp, err := client.ListMemberSchemasSender(req) 471 if err != nil { 472 result.Response = autorest.Response{Response: resp} 473 return result, autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listMemberSchemasNextResults", resp, "Failure sending next results request") 474 } 475 result, err = client.ListMemberSchemasResponder(resp) 476 if err != nil { 477 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "listMemberSchemasNextResults", resp, "Failure responding to next results request") 478 } 479 return 480} 481 482// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 483// ListMemberSchemasComplete enumerates all values, automatically crossing page boundaries as required. 484func (client SyncMembersClient) ListMemberSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncFullSchemaPropertiesListResultIterator, err error) { 485 result.page, err = client.ListMemberSchemas(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) 486 return 487} 488 489// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 490// RefreshMemberSchema refreshes a sync member database schema. 491// 492// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from 493// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of 494// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync 495// member is hosted. syncMemberName is the name of the sync member. 496func (client SyncMembersClient) RefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result SyncMembersRefreshMemberSchemaFuture, err error) { 497 req, err := client.RefreshMemberSchemaPreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName) 498 if err != nil { 499 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "RefreshMemberSchema", nil, "Failure preparing request") 500 return 501 } 502 503 result, err = client.RefreshMemberSchemaSender(req) 504 if err != nil { 505 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "RefreshMemberSchema", result.Response(), "Failure sending request") 506 return 507 } 508 509 return 510} 511 512// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 513// RefreshMemberSchemaPreparer prepares the RefreshMemberSchema request. 514func (client SyncMembersClient) RefreshMemberSchemaPreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (*http.Request, error) { 515 pathParameters := map[string]interface{}{ 516 "databaseName": autorest.Encode("path", databaseName), 517 "resourceGroupName": autorest.Encode("path", resourceGroupName), 518 "serverName": autorest.Encode("path", serverName), 519 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 520 "syncGroupName": autorest.Encode("path", syncGroupName), 521 "syncMemberName": autorest.Encode("path", syncMemberName), 522 } 523 524 const APIVersion = "2015-05-01-preview" 525 queryParameters := map[string]interface{}{ 526 "api-version": APIVersion, 527 } 528 529 preparer := autorest.CreatePreparer( 530 autorest.AsPost(), 531 autorest.WithBaseURL(client.BaseURI), 532 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema", pathParameters), 533 autorest.WithQueryParameters(queryParameters)) 534 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 535} 536 537// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 538// RefreshMemberSchemaSender sends the RefreshMemberSchema request. The method will close the 539// http.Response Body if it receives an error. 540func (client SyncMembersClient) RefreshMemberSchemaSender(req *http.Request) (future SyncMembersRefreshMemberSchemaFuture, err error) { 541 sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) 542 future.Future = azure.NewFuture(req) 543 future.req = req 544 _, err = future.Done(sender) 545 if err != nil { 546 return 547 } 548 err = autorest.Respond(future.Response(), 549 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) 550 return 551} 552 553// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 554// RefreshMemberSchemaResponder handles the response to the RefreshMemberSchema request. The method always 555// closes the http.Response Body. 556func (client SyncMembersClient) RefreshMemberSchemaResponder(resp *http.Response) (result autorest.Response, err error) { 557 err = autorest.Respond( 558 resp, 559 client.ByInspecting(), 560 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 561 autorest.ByClosing()) 562 result.Response = resp 563 return 564} 565 566// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 567// Update updates an existing sync member. 568// 569// resourceGroupName is the name of the resource group that contains the resource. You can obtain this value from 570// the Azure Resource Manager API or the portal. serverName is the name of the server. databaseName is the name of 571// the database on which the sync group is hosted. syncGroupName is the name of the sync group on which the sync 572// member is hosted. syncMemberName is the name of the sync member. parameters is the requested sync member 573// resource state. 574func (client SyncMembersClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (result SyncMembersUpdateFuture, err error) { 575 req, err := client.UpdatePreparer(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters) 576 if err != nil { 577 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Update", nil, "Failure preparing request") 578 return 579 } 580 581 result, err = client.UpdateSender(req) 582 if err != nil { 583 err = autorest.NewErrorWithError(err, "sql.SyncMembersClient", "Update", result.Response(), "Failure sending request") 584 return 585 } 586 587 return 588} 589 590// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 591// UpdatePreparer prepares the Update request. 592func (client SyncMembersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember) (*http.Request, error) { 593 pathParameters := map[string]interface{}{ 594 "databaseName": autorest.Encode("path", databaseName), 595 "resourceGroupName": autorest.Encode("path", resourceGroupName), 596 "serverName": autorest.Encode("path", serverName), 597 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 598 "syncGroupName": autorest.Encode("path", syncGroupName), 599 "syncMemberName": autorest.Encode("path", syncMemberName), 600 } 601 602 const APIVersion = "2015-05-01-preview" 603 queryParameters := map[string]interface{}{ 604 "api-version": APIVersion, 605 } 606 607 preparer := autorest.CreatePreparer( 608 autorest.AsContentType("application/json; charset=utf-8"), 609 autorest.AsPatch(), 610 autorest.WithBaseURL(client.BaseURI), 611 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", pathParameters), 612 autorest.WithJSON(parameters), 613 autorest.WithQueryParameters(queryParameters)) 614 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 615} 616 617// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 618// UpdateSender sends the Update request. The method will close the 619// http.Response Body if it receives an error. 620func (client SyncMembersClient) UpdateSender(req *http.Request) (future SyncMembersUpdateFuture, err error) { 621 sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) 622 future.Future = azure.NewFuture(req) 623 future.req = req 624 _, err = future.Done(sender) 625 if err != nil { 626 return 627 } 628 err = autorest.Respond(future.Response(), 629 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) 630 return 631} 632 633// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql instead. 634// UpdateResponder handles the response to the Update request. The method always 635// closes the http.Response Body. 636func (client SyncMembersClient) UpdateResponder(resp *http.Response) (result SyncMember, err error) { 637 err = autorest.Respond( 638 resp, 639 client.ByInspecting(), 640 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 641 autorest.ByUnmarshallingJSON(&result), 642 autorest.ByClosing()) 643 result.Response = autorest.Response{Response: resp} 644 return 645} 646