Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from xpouyat/dev
Browse files Browse the repository at this point in the history
SourceLink, better support for .NET Core and other updates
  • Loading branch information
xpouyat authored Dec 20, 2023
2 parents 231d761 + be0ceed commit c8da53f
Show file tree
Hide file tree
Showing 36 changed files with 519 additions and 102 deletions.
2 changes: 1 addition & 1 deletion MK.IO/AccountFilter/AccountFiltersOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public async Task<AccountFilterSchema> CreateOrUpdateAsync(string accountFilterN
Properties = properties
};

string responseContent = await Client.CreateObjectAsync(url, JsonConvert.SerializeObject(content, ConverterLE.Settings));
string responseContent = await Client.CreateObjectPutAsync(url, JsonConvert.SerializeObject(content, ConverterLE.Settings));
return JsonConvert.DeserializeObject<AccountFilterSchema>(responseContent, ConverterLE.Settings) ?? throw new Exception("Error with account filter deserialization");
}

Expand Down
2 changes: 1 addition & 1 deletion MK.IO/Asset/AssetsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public async Task<AssetSchema> CreateOrUpdateAsync(string assetName, string cont
}
};

string responseContent = await Client.CreateObjectAsync(url, JsonConvert.SerializeObject(content, ConverterLE.Settings));
string responseContent = await Client.CreateObjectPutAsync(url, JsonConvert.SerializeObject(content, ConverterLE.Settings));
return JsonConvert.DeserializeObject<AssetSchema>(responseContent, ConverterLE.Settings) ?? throw new Exception("Error with asset deserialization");
}

Expand Down
2 changes: 1 addition & 1 deletion MK.IO/AssetFilter/AssetFiltersOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public async Task<AssetFilterSchema> CreateOrUpdateAsync(string assetName, strin
Properties = properties
};

string responseContent = await Client.CreateObjectAsync(url, JsonConvert.SerializeObject(content, ConverterLE.Settings));
string responseContent = await Client.CreateObjectPutAsync(url, JsonConvert.SerializeObject(content, ConverterLE.Settings));
return JsonConvert.DeserializeObject<AssetFilterSchema>(responseContent, ConverterLE.Settings) ?? throw new Exception("Error with asset filter deserialization");
}

Expand Down
2 changes: 1 addition & 1 deletion MK.IO/ContentKeyPolicy/ContentKeyPoliciesOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public async Task<ContentKeyPolicy> CreateAsync(string contentKeyPolicyName, Con
Argument.AssertNotNull(content, nameof(content));

var url = Client.GenerateApiUrl(_contentKeyPolicyApiUrl, contentKeyPolicyName);
string responseContent = await Client.CreateObjectAsync(url, content.ToJson());
string responseContent = await Client.CreateObjectPutAsync(url, content.ToJson());
return ContentKeyPolicy.FromJson(responseContent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public ContentKeyPolicyClearKeyConfiguration()
}

[JsonProperty("@odata.type")]
internal string OdataType => "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration";
internal override string OdataType => "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ContentKeyPolicyConfigurationFairPlay(string ask, string fairPlayPfx, str
}

[JsonProperty("@odata.type")]
internal string OdataType => "#Microsoft.Media.ContentKeyPolicyConfigurationFairPlay";
internal override string OdataType => "#Microsoft.Media.ContentKeyPolicyConfigurationFairPlay";

[JsonProperty("ask")]
public string Ask { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public ContentKeyPolicyConfigurationPlayReady(List<ContentKeyPolicyPlayReadyLice
}

[JsonProperty("@odata.type")]
internal string OdataType => "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration";
internal override string OdataType => "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration";

[JsonProperty("licenses")]
public List<ContentKeyPolicyPlayReadyLicense> Licenses { get; set; }
Expand Down
73 changes: 73 additions & 0 deletions MK.IO/CsharpDotNet2/Model/BlobStorageAzurePrivateConnection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using Newtonsoft.Json;
using System.Runtime.Serialization;
using System.Text;

namespace MK.IO.Models
{

/// <summary>
///
/// </summary>
[DataContract]
public class BlobStorageAzurePrivateConnection
{
/// <summary>
/// A message passed to the owner of the remote resource with this connection request.
/// </summary>
/// <value>A message passed to the owner of the remote resource with this connection request.</value>
[DataMember(Name = "requestMessage", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "requestMessage")]
public string RequestMessage { get; set; }

/// <summary>
/// The name of the resource group containing the storage account
/// </summary>
/// <value>The name of the resource group containing the storage account</value>
[DataMember(Name = "resourceGroupName", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "resourceGroupName")]
public string ResourceGroupName { get; set; }

/// <summary>
/// The name of the storage account. The full Azure ID should be /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Storage/storageAccounts/<storageAccountName>
/// </summary>
/// <value>The name of the storage account. The full Azure ID should be /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Storage/storageAccounts/<storageAccountName></value>
[DataMember(Name = "storageAccountName", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "storageAccountName")]
public string StorageAccountName { get; set; }

/// <summary>
/// The ID of the Azure subscription containing the storage account
/// </summary>
/// <value>The ID of the Azure subscription containing the storage account</value>
[DataMember(Name = "subscriptionId", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "subscriptionId")]
public Guid? SubscriptionId { get; set; }


/// <summary>
/// Get the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BlobStorageAzurePrivateConnection {\n");
sb.Append(" RequestMessage: ").Append(RequestMessage).Append("\n");
sb.Append(" ResourceGroupName: ").Append(ResourceGroupName).Append("\n");
sb.Append(" StorageAccountName: ").Append(StorageAccountName).Append("\n");
sb.Append(" SubscriptionId: ").Append(SubscriptionId).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Get the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, ConverterLE.Settings);
}

}
}
8 changes: 8 additions & 0 deletions MK.IO/CsharpDotNet2/Model/BlobStorageAzureProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ namespace MK.IO.Models
[DataContract]
public class BlobStorageAzureProperties
{
/// <summary>
/// Gets or Sets PrivateLinkServiceConnection
/// </summary>
[DataMember(Name = "privateLinkServiceConnection", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "privateLinkServiceConnection")]
public BlobStorageAzurePrivateConnection PrivateLinkServiceConnection { get; set; }

/// <summary>
/// HTTP(S) URL required for access to the storage.
/// </summary>
Expand All @@ -28,6 +35,7 @@ public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BlobStorageAzureProperties {\n");
sb.Append(" PrivateLinkServiceConnection: ").Append(PrivateLinkServiceConnection).Append("\n");
sb.Append(" Url: ").Append(Url).Append("\n");
sb.Append("}\n");
return sb.ToString();
Expand Down
2 changes: 1 addition & 1 deletion MK.IO/CsharpDotNet2/Model/JobProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class JobProperties
/// <value>The current state of the job.</value>
[DataMember(Name = "state", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "state")]
public JobState? State { get; private set; }
public JobState State { get; private set; }


/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions MK.IO/CsharpDotNet2/Model/LiveEventProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ public class LiveEventProperties
/// <value>The current provisioning state of the resource. One of 'InProgress', 'Succeeded', or 'Failed'</value>
[DataMember(Name = "provisioningState", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "provisioningState")]
public string ProvisioningState { get; set; }
public LiveEventProvisioningState ProvisioningState { get; private set; }

/// <summary>
/// The current state of the resource. One of 'Stopped', 'Starting', 'Running', 'Stopping', or 'Deleting'.
/// </summary>
/// <value>The current state of the resource. One of 'Stopped', 'Starting', 'Running', 'Stopping', or 'Deleting'.</value>
[DataMember(Name = "resourceState", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "resourceState")]
public string ResourceState { get; set; }
public LiveEventResourceState ResourceState { get; private set; }

/// <summary>
/// A list of streaming options for the live event. One of 'Default' or 'LowLatency'. Only one value permitted in the list.
Expand Down
8 changes: 5 additions & 3 deletions MK.IO/CsharpDotNet2/Model/LiveOutputProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,20 @@ public class LiveOutputProperties
/// <value>The provisioning state of the live output.</value>
[DataMember(Name = "provisioningState", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "provisioningState")]
public string ProvisioningState { get; set; }
public LiveOutputProvisioningState ProvisioningState { get; private set; }

/// <summary>
/// The resource state of the live output.
/// </summary>
/// <value>The resource state of the live output.</value>
[DataMember(Name = "resourceState", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "resourceState")]
public string ResourceState { get; set; }
public LiveOutputResourceState ResourceState { get; private set; }

/// <summary>
/// Not supported. ISO 8601 timespan duration of the rewind window length during live playback. This is the amount of time that the live output will be able to rewind.
/// Not supported.
/// ISO 8601 timespan duration of the rewind window length during live playback.
/// This is the amount of time that the live output will be able to rewind.
/// </summary>
/// <value>Not supported. ISO 8601 timespan duration of the rewind window length during live playback. This is the amount of time that the live output will be able to rewind.</value>
[DataMember(Name = "rewindWindowLength", EmitDefaultValue = false)]
Expand Down
9 changes: 0 additions & 9 deletions MK.IO/CsharpDotNet2/Model/StorageMetadataSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ namespace MK.IO.Models
[DataContract]
public class StorageMetadataSchema
{
/// <summary>
/// The unique identifier of the credential that is currently active for the storage account.
/// </summary>
/// <value>The unique identifier of the credential that is currently active for the storage account.</value>
[DataMember(Name = "activeCredentialId", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "activeCredentialId")]
public Guid? ActiveCredentialId { get; set; }

/// <summary>
/// The date and time when the storage account was created.
/// </summary>
Expand Down Expand Up @@ -68,7 +60,6 @@ public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class StorageMetadataSchema {\n");
sb.Append(" ActiveCredentialId: ").Append(ActiveCredentialId).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" CreatedById: ").Append(CreatedById).Append("\n");
sb.Append(" Id: ").Append(Id).Append("\n");
Expand Down
13 changes: 11 additions & 2 deletions MK.IO/CsharpDotNet2/Model/StorageResponseSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@ namespace MK.IO.Models
public class StorageResponseSchema
{
/// <summary>
/// Gets or Sets Metadata
/// Metadata about the storage account
/// </summary>
[DataMember(Name = "metadata", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "metadata")]
public StorageMetadataSchema Metadata { get; set; }

/// <summary>
/// Gets or Sets Spec
/// The specification of the storage account
/// </summary>
[DataMember(Name = "spec", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "spec")]
public StorageSchema Spec { get; set; }


/// <summary>
/// Gets or Sets Status
/// </summary>
[DataMember(Name = "status", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "status")]
public StorageStatusSchema Status { get; set; }


/// <summary>
/// Get the string presentation of the object
/// </summary>
Expand All @@ -36,6 +44,7 @@ public override string ToString()
sb.Append("class StorageResponseSchema {\n");
sb.Append(" Metadata: ").Append(Metadata).Append("\n");
sb.Append(" Spec: ").Append(Spec).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down
55 changes: 55 additions & 0 deletions MK.IO/CsharpDotNet2/Model/StorageStatusSchema.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Text;
using System.Runtime.Serialization;
using Newtonsoft.Json;

namespace MK.IO.Models
{

/// <summary>
///
/// </summary>
[DataContract]
public class StorageStatusSchema
{
/// <summary>
/// The unique identifier of the credential that is currently active for the storage account.
/// </summary>
/// <value>The unique identifier of the credential that is currently active for the storage account.</value>
[DataMember(Name = "activeCredentialId", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "activeCredentialId")]
public Guid? ActiveCredentialId { get; private set; }

/// <summary>
/// The state of the Azure Private Connection, if enabled.
/// </summary>
/// <value>The state of the Azure Private Connection, if enabled.</value>
[DataMember(Name = "privateLinkServiceConnectionStatus", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "privateLinkServiceConnectionStatus")]
public PrivateLinkServiceConnectionState PrivateLinkServiceConnectionStatus { get; private set; }


/// <summary>
/// Get the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class StorageStatusSchema {\n");
sb.Append(" ActiveCredentialId: ").Append(ActiveCredentialId).Append("\n");
sb.Append(" PrivateLinkServiceConnectionStatus: ").Append(PrivateLinkServiceConnectionStatus).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Get the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, ConverterLE.Settings);
}

}
}
2 changes: 1 addition & 1 deletion MK.IO/Job/JobsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public async Task<JobSchema> CreateAsync(string transformName, string jobName, J
}
var content = new JobSchema { Properties = properties };

string responseContent = await Client.CreateObjectAsync(url, content.ToJson());
string responseContent = await Client.CreateObjectPutAsync(url, content.ToJson());
return JsonConvert.DeserializeObject<JobSchema>(responseContent, ConverterLE.Settings) ?? throw new Exception("Error with job deserialization");
}

Expand Down
13 changes: 13 additions & 0 deletions MK.IO/Job/Models/JobInputAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,18 @@ public JobInputAsset(string assetName, List<string> files)

[JsonProperty("files")]
public List<string> Files { get; set; }

/// <summary>
/// Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
/// </summary>
[JsonProperty("start")]
public JobInputTime? Start { get; set; }

/// <summary>
/// Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
/// </summary>
[JsonProperty("end")]
public JobInputTime? End { get; set; }

}
}
4 changes: 2 additions & 2 deletions MK.IO/Job/Models/JobInputHttp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public JobInputHttp(string? baseUri, List<string> files)
public string? BaseUri { get; set; }

/// <summary>
/// Gets or Sets Start
/// Defines a point on the timeline of the input media at which processing will start. Defaults to the beginning of the input media.
/// </summary>
[JsonProperty("start")]
public JobInputTime? Start { get; set; }

/// <summary>
/// Gets or Sets End
/// Defines a point on the timeline of the input media at which processing will end. Defaults to the end of the input media.
/// </summary>
[JsonProperty("end")]
public JobInputTime? End { get; set; }
Expand Down
Loading

0 comments on commit c8da53f

Please sign in to comment.