public async Task <UpdateCampaign> Create(UpdateCampaign request) { try { var bodyParams = new UpdateCampaign { Description = request.Description, DeviceFilter = request.DeviceFilter, Name = request.Name, RootManifestId = request.RootManifestId, When = request.When, }; return(await Client.CallApi <UpdateCampaign>(path : "/v3/update-campaigns/", bodyParams : bodyParams, objectToUnpack : request, method : HttpMethods.POST)); } catch (ApiException e) { throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent); } }
public async Task <UpdateCampaign> Update(string id, UpdateCampaign request) { try { var pathParams = new Dictionary <string, object> { { "campaign_id", id }, }; var bodyParams = new UpdateCampaign { Description = request.Description, DeviceFilter = request.DeviceFilter, Name = request.Name, RootManifestId = request.RootManifestId, When = request.When, }; return(await Client.CallApi <UpdateCampaign>(path : "/v3/update-campaigns/{campaign_id}/", pathParams : pathParams, bodyParams : bodyParams, objectToUnpack : request, method : HttpMethods.PUT)); } catch (ApiException e) { throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent); } }