From cb0e2f5e949261f12bd910eec9830424ce7ddb90 Mon Sep 17 00:00:00 2001 From: Kunal Johar Date: Mon, 29 Apr 2013 11:09:38 -0400 Subject: [PATCH 1/3] Add grouping support to CreateJobRequest --- Source/Zencoder/CreateJobRequest.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Zencoder/CreateJobRequest.cs b/Source/Zencoder/CreateJobRequest.cs index 9e9a4f3..3af786b 100644 --- a/Source/Zencoder/CreateJobRequest.cs +++ b/Source/Zencoder/CreateJobRequest.cs @@ -70,6 +70,13 @@ public CreateJobRequest(string apiKey, Uri baseUrl) [JsonProperty("region", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)] public string Region { get; set; } + /// + /// Gets or sets the grouping to use when processing the job. + /// Defaults to "us". + /// + [JsonProperty("grouping", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)] + public string Grouping { get; set; } + /// /// Gets or sets a value indicating whether test mode is enabled for the job. /// From ce2f946ca6298ebd09be52475ec6857d93cdf4ef Mon Sep 17 00:00:00 2001 From: Kunal Johar Date: Mon, 29 Apr 2013 11:19:56 -0400 Subject: [PATCH 2/3] Finished support for grouping --- Source/Zencoder/Zencoder.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Zencoder/Zencoder.cs b/Source/Zencoder/Zencoder.cs index 62ef3ea..a4b5cce 100644 --- a/Source/Zencoder/Zencoder.cs +++ b/Source/Zencoder/Zencoder.cs @@ -246,7 +246,7 @@ public CreateJobResponse CreateJob(string input, IEnumerable outputs) /// The call response. public void CreateJob(string input, IEnumerable outputs, Action callback) { - this.CreateJob(input, outputs, null, null, null, null, callback); + this.CreateJob(input, outputs, null, null, null, null, null, callback); } /// @@ -280,10 +280,11 @@ public CreateJobResponse CreateJob(string input, IEnumerable outputs, in /// The output definition collection. /// The number of download connections to use when fetching the input file. /// The region to perform the job in. + /// /// The grouping to use with reporting. /// A value indicating whether to use test mode. /// A value indicating whether to mock the response rather than actually creating a job. /// The call response. - public void CreateJob(string input, IEnumerable outputs, int? downloadConnections, string region, bool? test, bool? mock, Action callback) + public void CreateJob(string input, IEnumerable outputs, int? downloadConnections, string region, string grouping, bool? test, bool? mock, Action callback) { CreateJobRequest request = new CreateJobRequest(this) { @@ -291,6 +292,7 @@ public void CreateJob(string input, IEnumerable outputs, int? downloadCo Input = input, Mock = mock, Region = region, + Grouping = grouping, Test = test }; From 58e8c51e7b74bf7b83ebff6083ba082fe6e91134 Mon Sep 17 00:00:00 2001 From: Kunal Johar Date: Mon, 29 Apr 2013 11:45:20 -0400 Subject: [PATCH 3/3] Fix CreateJob overload Revert last commit which broke Api Added new Overload to support grouping --- Source/Zencoder/Zencoder.cs | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/Source/Zencoder/Zencoder.cs b/Source/Zencoder/Zencoder.cs index a4b5cce..ff9ed27 100644 --- a/Source/Zencoder/Zencoder.cs +++ b/Source/Zencoder/Zencoder.cs @@ -246,7 +246,7 @@ public CreateJobResponse CreateJob(string input, IEnumerable outputs) /// The call response. public void CreateJob(string input, IEnumerable outputs, Action callback) { - this.CreateJob(input, outputs, null, null, null, null, null, callback); + this.CreateJob(input, outputs, null, null, null, null, callback); } /// @@ -280,11 +280,10 @@ public CreateJobResponse CreateJob(string input, IEnumerable outputs, in /// The output definition collection. /// The number of download connections to use when fetching the input file. /// The region to perform the job in. - /// /// The grouping to use with reporting. /// A value indicating whether to use test mode. /// A value indicating whether to mock the response rather than actually creating a job. /// The call response. - public void CreateJob(string input, IEnumerable outputs, int? downloadConnections, string region, string grouping, bool? test, bool? mock, Action callback) + public void CreateJob(string input, IEnumerable outputs, int? downloadConnections, string region, bool? test, bool? mock, Action callback) { CreateJobRequest request = new CreateJobRequest(this) { @@ -292,13 +291,38 @@ public void CreateJob(string input, IEnumerable outputs, int? downloadCo Input = input, Mock = mock, Region = region, - Grouping = grouping, Test = test }; request.WithOutputs(outputs).GetResponseAsync(callback); } + /// + /// A blocking create job request/response cycle. + /// + /// The URL of the input file. + /// The output definition collection. + /// The number of download connections to use when fetching the input file. + /// The region to perform the job in. + /// The grouping to use with reporting. + /// A value indicating whether to use test mode. + /// A value indicating whether to mock the response rather than actually creating a job. + /// The call response. + public void CreateJob(string input, IEnumerable outputs, int? downloadConnections, string region, string grouping, bool? test, bool? mock, Action callback) + { + CreateJobRequest request = new CreateJobRequest(this) + { + DownloadConnections = downloadConnections, + Input = input, + Mock = mock, + Region = region, + Test = test, + Grouping = grouping + }; + + request.WithOutputs(outputs).GetResponseAsync(callback); + } + /// /// A blocking delete job request/response cycle. ///