Skip to content

Commit

Permalink
Regenerated EventGrid DataPlane SDK to include new event types.
Browse files Browse the repository at this point in the history
  • Loading branch information
kalyanaj committed May 22, 2018
1 parent 8197f7d commit e76015b
Show file tree
Hide file tree
Showing 10 changed files with 706 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.EventGrid.Models
{
using Newtonsoft.Json;

/// <summary>
/// Defines values for JobState.
/// </summary>
/// <summary>
/// Determine base value for a given allowed value if exists, else return
/// the value itself
/// </summary>
[JsonConverter(typeof(JobStateConverter))]
public struct JobState : System.IEquatable<JobState>
{
private JobState(string underlyingValue)
{
UnderlyingValue=underlyingValue;
}

/// <summary>
/// The job was canceled. This is a final state for the job.
/// </summary>
public static readonly JobState Canceled = "Canceled";

/// <summary>
/// The job is in the process of being canceled. This is a transient
/// state for the job.
/// </summary>
public static readonly JobState Canceling = "Canceling";

/// <summary>
/// The job has encountered an error. This is a final state for the
/// job.
/// </summary>
public static readonly JobState Error = "Error";

/// <summary>
/// The job is finished. This is a final state for the job.
/// </summary>
public static readonly JobState Finished = "Finished";

/// <summary>
/// The job is processing. This is a transient state for the job.
/// </summary>
public static readonly JobState Processing = "Processing";

/// <summary>
/// The job is in a queued state, waiting for resources to become
/// available. This is a transient state.
/// </summary>
public static readonly JobState Queued = "Queued";

/// <summary>
/// The job is being scheduled to run on an available resource. This is
/// a transient state, between queued and processing states.
/// </summary>
public static readonly JobState Scheduled = "Scheduled";


/// <summary>
/// Underlying value of enum JobState
/// </summary>
private readonly string UnderlyingValue;

/// <summary>
/// Returns string representation for JobState
/// </summary>
public override string ToString()
{
return UnderlyingValue.ToString();
}

/// <summary>
/// Compares enums of type JobState
/// </summary>
public bool Equals(JobState e)
{
return UnderlyingValue.Equals(e.UnderlyingValue);
}

/// <summary>
/// Implicit operator to convert string to JobState
/// </summary>
public static implicit operator JobState(string value)
{
return new JobState(value);
}

/// <summary>
/// Implicit operator to convert JobState to string
/// </summary>
public static implicit operator string(JobState e)
{
return e.UnderlyingValue;
}

/// <summary>
/// Overriding == operator for enum JobState
/// </summary>
public static bool operator == (JobState e1, JobState e2)
{
return e2.Equals(e1);
}

/// <summary>
/// Overriding != operator for enum JobState
/// </summary>
public static bool operator != (JobState e1, JobState e2)
{
return !e2.Equals(e1);
}

/// <summary>
/// Overrides Equals operator for JobState
/// </summary>
public override bool Equals(object obj)
{
return obj is JobState && Equals((JobState)obj);
}

/// <summary>
/// Returns for hashCode JobState
/// </summary>
public override int GetHashCode()
{
return UnderlyingValue.GetHashCode();
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.EventGrid.Models
{
using Newtonsoft.Json;

using System.Reflection;

/// <summary>
/// Defines values for JobState.
/// </summary>
public sealed class JobStateConverter : JsonConverter
{

/// <summary>
/// Returns if objectType can be converted to JobState by the
/// converter.
/// </summary>
public override bool CanConvert(System.Type objectType)
{
return typeof(JobState).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo());
}

/// <summary>
/// Overrides ReadJson and converts token to JobState.
/// </summary>
public override object ReadJson(JsonReader reader, System.Type objectType, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == Newtonsoft.Json.JsonToken.Null)
{
return null;
}
return (JobState)serializer.Deserialize<string>(reader);
}

/// <summary>
/// Overriding WriteJson for JobState for serialization.
/// </summary>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.EventGrid.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Schema of the Data property of an EventGridEvent for a
/// Microsoft.Media.JobStateChange event.
/// </summary>
public partial class MediaJobStateChangeEventData
{
/// <summary>
/// Initializes a new instance of the MediaJobStateChangeEventData
/// class.
/// </summary>
public MediaJobStateChangeEventData()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the MediaJobStateChangeEventData
/// class.
/// </summary>
/// <param name="previousState">The previous state of the Job. Possible
/// values include: 'Canceled', 'Canceling', 'Error', 'Finished',
/// 'Processing', 'Queued', 'Scheduled'</param>
/// <param name="state">The new state of the Job. Possible values
/// include: 'Canceled', 'Canceling', 'Error', 'Finished',
/// 'Processing', 'Queued', 'Scheduled'</param>
public MediaJobStateChangeEventData(JobState previousState = default(JobState), JobState state = default(JobState))
{
PreviousState = previousState;
State = state;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets the previous state of the Job. Possible values include:
/// 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing',
/// 'Queued', 'Scheduled'
/// </summary>
[JsonProperty(PropertyName = "previousState")]
public JobState PreviousState { get; private set; }

/// <summary>
/// Gets the new state of the Job. Possible values include: 'Canceled',
/// 'Canceling', 'Error', 'Finished', 'Processing', 'Queued',
/// 'Scheduled'
/// </summary>
[JsonProperty(PropertyName = "state")]
public JobState State { get; private set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.EventGrid.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// Schema of the Data property of an EventGridEvent for a
/// Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event.
/// </summary>
public partial class ServiceBusActiveMessagesAvailableWithNoListenersEventData
{
/// <summary>
/// Initializes a new instance of the
/// ServiceBusActiveMessagesAvailableWithNoListenersEventData class.
/// </summary>
public ServiceBusActiveMessagesAvailableWithNoListenersEventData()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the
/// ServiceBusActiveMessagesAvailableWithNoListenersEventData class.
/// </summary>
/// <param name="namespaceName">The namespace name of the
/// Microsoft.ServiceBus resource.</param>
/// <param name="requestUri">The endpoint of the Microsoft.ServiceBus
/// resource.</param>
/// <param name="entityType">The entity type of the
/// Microsoft.ServiceBus resource. Could be one of 'queue' or
/// 'subscriber'.</param>
/// <param name="queueName">The name of the Microsoft.ServiceBus queue.
/// If the entity type is of type 'subscriber', then this value will be
/// null.</param>
/// <param name="topicName">The name of the Microsoft.ServiceBus topic.
/// If the entity type is of type 'queue', then this value will be
/// null.</param>
/// <param name="subscriptionName">The name of the Microsoft.ServiceBus
/// topic's subscription. If the entity type is of type 'queue', then
/// this value will be null.</param>
public ServiceBusActiveMessagesAvailableWithNoListenersEventData(string namespaceName = default(string), string requestUri = default(string), string entityType = default(string), string queueName = default(string), string topicName = default(string), string subscriptionName = default(string))
{
NamespaceName = namespaceName;
RequestUri = requestUri;
EntityType = entityType;
QueueName = queueName;
TopicName = topicName;
SubscriptionName = subscriptionName;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets the namespace name of the Microsoft.ServiceBus
/// resource.
/// </summary>
[JsonProperty(PropertyName = "namespaceName")]
public string NamespaceName { get; set; }

/// <summary>
/// Gets or sets the endpoint of the Microsoft.ServiceBus resource.
/// </summary>
[JsonProperty(PropertyName = "requestUri")]
public string RequestUri { get; set; }

/// <summary>
/// Gets or sets the entity type of the Microsoft.ServiceBus resource.
/// Could be one of 'queue' or 'subscriber'.
/// </summary>
[JsonProperty(PropertyName = "entityType")]
public string EntityType { get; set; }

/// <summary>
/// Gets or sets the name of the Microsoft.ServiceBus queue. If the
/// entity type is of type 'subscriber', then this value will be null.
/// </summary>
[JsonProperty(PropertyName = "queueName")]
public string QueueName { get; set; }

/// <summary>
/// Gets or sets the name of the Microsoft.ServiceBus topic. If the
/// entity type is of type 'queue', then this value will be null.
/// </summary>
[JsonProperty(PropertyName = "topicName")]
public string TopicName { get; set; }

/// <summary>
/// Gets or sets the name of the Microsoft.ServiceBus topic's
/// subscription. If the entity type is of type 'queue', then this
/// value will be null.
/// </summary>
[JsonProperty(PropertyName = "subscriptionName")]
public string SubscriptionName { get; set; }

}
}
Loading

0 comments on commit e76015b

Please sign in to comment.