* regen clean fix

* clean

* dead structurally equals
This commit is contained in:
Johannes Bader 2017-06-27 10:57:10 -07:00 коммит произвёл GitHub
Родитель 8e9c2d3704
Коммит c3968684c0
27 изменённых файлов: 7 добавлений и 1927 удалений

Просмотреть файл

@ -1,63 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Searchservice
{
using Models;
using Newtonsoft.Json;
/// <summary>
/// </summary>
public partial interface IStorageManagementClient : System.IDisposable
{
/// <summary>
/// The base URI of the service.
/// </summary>
System.Uri BaseUri { get; set; }
/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
JsonSerializerSettings SerializationSettings { get; }
/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
JsonSerializerSettings DeserializationSettings { get; }
/// <summary>
/// Subscription credentials which uniquely identify the Microsoft
/// Azure subscription. The subscription ID forms part of the URI for
/// every service call.
/// </summary>
string SubscriptionId { get; set; }
/// <summary>
/// Gets the IDataSources.
/// </summary>
IDataSources DataSources { get; }
/// <summary>
/// Gets the IIndexers.
/// </summary>
IIndexers Indexers { get; }
/// <summary>
/// Gets the IIndexes.
/// </summary>
IIndexes Indexes { get; }
/// <summary>
/// Gets the IStorageAccounts.
/// </summary>
IStorageAccounts StorageAccounts { get; }
/// <summary>
/// Gets the IUsageOperations.
/// </summary>
IUsageOperations Usage { get; }
}
}

Просмотреть файл

@ -1,186 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Searchservice
{
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Models;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
public partial class StorageManagementClient : ServiceClient<StorageManagementClient>, IStorageManagementClient
{
/// <summary>
/// The base URI of the service.
/// </summary>
public System.Uri BaseUri { get; set; }
/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
public JsonSerializerSettings SerializationSettings { get; private set; }
/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
public JsonSerializerSettings DeserializationSettings { get; private set; }
/// <summary>
/// Subscription credentials which uniquely identify the Microsoft Azure
/// subscription. The subscription ID forms part of the URI for every service
/// call.
/// </summary>
public string SubscriptionId { get; set; }
/// <summary>
/// Gets the IDataSources.
/// </summary>
public virtual IDataSources DataSources { get; private set; }
/// <summary>
/// Gets the IIndexers.
/// </summary>
public virtual IIndexers Indexers { get; private set; }
/// <summary>
/// Gets the IIndexes.
/// </summary>
public virtual IIndexes Indexes { get; private set; }
/// <summary>
/// Gets the IStorageAccounts.
/// </summary>
public virtual IStorageAccounts StorageAccounts { get; private set; }
/// <summary>
/// Gets the IUsageOperations.
/// </summary>
public virtual IUsageOperations Usage { get; private set; }
/// <summary>
/// Initializes a new instance of the StorageManagementClient class.
/// </summary>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
public StorageManagementClient(params DelegatingHandler[] handlers) : base(handlers)
{
Initialize();
}
/// <summary>
/// Initializes a new instance of the StorageManagementClient class.
/// </summary>
/// <param name='rootHandler'>
/// Optional. The http client handler used to handle http transport.
/// </param>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
public StorageManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
{
Initialize();
}
/// <summary>
/// Initializes a new instance of the StorageManagementClient class.
/// </summary>
/// <param name='baseUri'>
/// Optional. The base URI of the service.
/// </param>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public StorageManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
BaseUri = baseUri;
}
/// <summary>
/// Initializes a new instance of the StorageManagementClient class.
/// </summary>
/// <param name='baseUri'>
/// Optional. The base URI of the service.
/// </param>
/// <param name='rootHandler'>
/// Optional. The http client handler used to handle http transport.
/// </param>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public StorageManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
BaseUri = baseUri;
}
/// <summary>
/// An optional partial-method to perform custom initialization.
///</summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
private void Initialize()
{
DataSources = new DataSources(this);
Indexers = new Indexers(this);
Indexes = new Indexes(this);
StorageAccounts = new StorageAccounts(this);
Usage = new UsageOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
SerializationSettings = new JsonSerializerSettings
{
Formatting = Newtonsoft.Json.Formatting.Indented,
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
ContractResolver = new ReadOnlyJsonContractResolver(),
Converters = new List<JsonConverter>
{
new Iso8601TimeSpanConverter()
}
};
SerializationSettings.Converters.Add(new TransformationJsonConverter());
DeserializationSettings = new JsonSerializerSettings
{
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
ContractResolver = new ReadOnlyJsonContractResolver(),
Converters = new List<JsonConverter>
{
new Iso8601TimeSpanConverter()
}
};
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<DataChangeDetectionPolicy>("@odata.type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<DataChangeDetectionPolicy>("@odata.type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<DataDeletionDetectionPolicy>("@odata.type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<DataDeletionDetectionPolicy>("@odata.type"));
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<ScoringFunction>("type"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<ScoringFunction>("type"));
CustomInitialize();
DeserializationSettings.Converters.Add(new TransformationJsonConverter());
}
}
}

Просмотреть файл

@ -1,50 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Response for ApplicationGatewayAvailableWafRuleSets API service call.
/// </summary>
public partial class ApplicationGatewayAvailableWafRuleSetsResult
{
/// <summary>
/// Initializes a new instance of the
/// ApplicationGatewayAvailableWafRuleSetsResult class.
/// </summary>
public ApplicationGatewayAvailableWafRuleSetsResult()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the
/// ApplicationGatewayAvailableWafRuleSetsResult class.
/// </summary>
/// <param name="value">The list of application gateway rule
/// sets.</param>
public ApplicationGatewayAvailableWafRuleSetsResult(IList<ApplicationGatewayFirewallRuleSet> value = default(IList<ApplicationGatewayFirewallRuleSet>))
{
Value = value;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the list of application gateway rule sets.
/// </summary>
[JsonProperty(PropertyName = "value")]
public IList<ApplicationGatewayFirewallRuleSet> Value { get; set; }
}
}

Просмотреть файл

@ -1,74 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Allows to disable rules within a rule group or an entire rule group.
/// </summary>
public partial class ApplicationGatewayFirewallDisabledRuleGroup
{
/// <summary>
/// Initializes a new instance of the
/// ApplicationGatewayFirewallDisabledRuleGroup class.
/// </summary>
public ApplicationGatewayFirewallDisabledRuleGroup()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the
/// ApplicationGatewayFirewallDisabledRuleGroup class.
/// </summary>
/// <param name="ruleGroupName">The name of the rule group that will be
/// disabled.</param>
/// <param name="rules">The list of rules that will be disabled. If
/// null, all rules of the rule group will be disabled.</param>
public ApplicationGatewayFirewallDisabledRuleGroup(string ruleGroupName, IList<int> rules = default(IList<int>))
{
RuleGroupName = ruleGroupName;
Rules = rules;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the name of the rule group that will be disabled.
/// </summary>
[JsonProperty(PropertyName = "ruleGroupName")]
public string RuleGroupName { get; set; }
/// <summary>
/// Gets or sets the list of rules that will be disabled. If null, all
/// rules of the rule group will be disabled.
/// </summary>
[JsonProperty(PropertyName = "rules")]
public IList<int> Rules { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (RuleGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupName");
}
}
}
}

Просмотреть файл

@ -1,67 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
using Newtonsoft.Json;
using System.Linq;
/// <summary>
/// A web application firewall rule.
/// </summary>
public partial class ApplicationGatewayFirewallRule
{
/// <summary>
/// Initializes a new instance of the ApplicationGatewayFirewallRule
/// class.
/// </summary>
public ApplicationGatewayFirewallRule()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the ApplicationGatewayFirewallRule
/// class.
/// </summary>
/// <param name="ruleId">The identifier of the web application firewall
/// rule.</param>
/// <param name="description">The description of the web application
/// firewall rule.</param>
public ApplicationGatewayFirewallRule(int ruleId, string description = default(string))
{
RuleId = ruleId;
Description = description;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the identifier of the web application firewall rule.
/// </summary>
[JsonProperty(PropertyName = "ruleId")]
public int RuleId { get; set; }
/// <summary>
/// Gets or sets the description of the web application firewall rule.
/// </summary>
[JsonProperty(PropertyName = "description")]
public string Description { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
//Nothing to validate
}
}
}

Просмотреть файл

@ -1,97 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// A web application firewall rule group.
/// </summary>
public partial class ApplicationGatewayFirewallRuleGroup
{
/// <summary>
/// Initializes a new instance of the
/// ApplicationGatewayFirewallRuleGroup class.
/// </summary>
public ApplicationGatewayFirewallRuleGroup()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the
/// ApplicationGatewayFirewallRuleGroup class.
/// </summary>
/// <param name="ruleGroupName">The name of the web application
/// firewall rule group.</param>
/// <param name="rules">The rules of the web application firewall rule
/// group.</param>
/// <param name="description">The description of the web application
/// firewall rule group.</param>
public ApplicationGatewayFirewallRuleGroup(string ruleGroupName, IList<ApplicationGatewayFirewallRule> rules, string description = default(string))
{
RuleGroupName = ruleGroupName;
Description = description;
Rules = rules;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the name of the web application firewall rule group.
/// </summary>
[JsonProperty(PropertyName = "ruleGroupName")]
public string RuleGroupName { get; set; }
/// <summary>
/// Gets or sets the description of the web application firewall rule
/// group.
/// </summary>
[JsonProperty(PropertyName = "description")]
public string Description { get; set; }
/// <summary>
/// Gets or sets the rules of the web application firewall rule group.
/// </summary>
[JsonProperty(PropertyName = "rules")]
public IList<ApplicationGatewayFirewallRule> Rules { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (RuleGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupName");
}
if (Rules == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Rules");
}
if (Rules != null)
{
foreach (var element in Rules)
{
if (element != null)
{
element.Validate();
}
}
}
}
}
}

Просмотреть файл

@ -1,120 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// A web application firewall rule set.
/// </summary>
[JsonTransformation]
public partial class ApplicationGatewayFirewallRuleSet : Resource
{
/// <summary>
/// Initializes a new instance of the ApplicationGatewayFirewallRuleSet
/// class.
/// </summary>
public ApplicationGatewayFirewallRuleSet()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the ApplicationGatewayFirewallRuleSet
/// class.
/// </summary>
/// <param name="ruleSetType">The type of the web application firewall
/// rule set.</param>
/// <param name="ruleSetVersion">The version of the web application
/// firewall rule set type.</param>
/// <param name="ruleGroups">The rule groups of the web application
/// firewall rule set.</param>
/// <param name="id">Resource ID.</param>
/// <param name="name">Resource name.</param>
/// <param name="type">Resource type.</param>
/// <param name="location">Resource location.</param>
/// <param name="tags">Resource tags.</param>
/// <param name="provisioningState">The provisioning state of the web
/// application firewall rule set.</param>
public ApplicationGatewayFirewallRuleSet(string ruleSetType, string ruleSetVersion, IList<ApplicationGatewayFirewallRuleGroup> ruleGroups, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), string provisioningState = default(string))
: base(id, name, type, location, tags)
{
ProvisioningState = provisioningState;
RuleSetType = ruleSetType;
RuleSetVersion = ruleSetVersion;
RuleGroups = ruleGroups;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the provisioning state of the web application firewall
/// rule set.
/// </summary>
[JsonProperty(PropertyName = "properties.provisioningState")]
public string ProvisioningState { get; set; }
/// <summary>
/// Gets or sets the type of the web application firewall rule set.
/// </summary>
[JsonProperty(PropertyName = "properties.ruleSetType")]
public string RuleSetType { get; set; }
/// <summary>
/// Gets or sets the version of the web application firewall rule set
/// type.
/// </summary>
[JsonProperty(PropertyName = "properties.ruleSetVersion")]
public string RuleSetVersion { get; set; }
/// <summary>
/// Gets or sets the rule groups of the web application firewall rule
/// set.
/// </summary>
[JsonProperty(PropertyName = "properties.ruleGroups")]
public IList<ApplicationGatewayFirewallRuleGroup> RuleGroups { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (RuleSetType == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetType");
}
if (RuleSetVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetVersion");
}
if (RuleGroups == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroups");
}
if (RuleGroups != null)
{
foreach (var element in RuleGroups)
{
if (element != null)
{
element.Validate();
}
}
}
}
}
}

Просмотреть файл

@ -1,22 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
/// <summary>
/// Defines values for DhGroup.
/// </summary>
public static class DhGroup
{
public const string None = "None";
public const string DHGroup1 = "DHGroup1";
public const string DHGroup2 = "DHGroup2";
public const string DHGroup14 = "DHGroup14";
public const string DHGroup2048 = "DHGroup2048";
public const string ECP256 = "ECP256";
public const string ECP384 = "ECP384";
public const string DHGroup24 = "DHGroup24";
}
}

Просмотреть файл

@ -1,19 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
/// <summary>
/// Defines values for IkeEncryption.
/// </summary>
public static class IkeEncryption
{
public const string DES = "DES";
public const string DES3 = "DES3";
public const string AES128 = "AES128";
public const string AES192 = "AES192";
public const string AES256 = "AES256";
}
}

Просмотреть файл

@ -1,18 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
/// <summary>
/// Defines values for IkeIntegrity.
/// </summary>
public static class IkeIntegrity
{
public const string MD5 = "MD5";
public const string SHA1 = "SHA1";
public const string SHA256 = "SHA256";
public const string SHA384 = "SHA384";
}
}

Просмотреть файл

@ -1,23 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
/// <summary>
/// Defines values for IpsecEncryption.
/// </summary>
public static class IpsecEncryption
{
public const string None = "None";
public const string DES = "DES";
public const string DES3 = "DES3";
public const string AES128 = "AES128";
public const string AES192 = "AES192";
public const string AES256 = "AES256";
public const string GCMAES128 = "GCMAES128";
public const string GCMAES192 = "GCMAES192";
public const string GCMAES256 = "GCMAES256";
}
}

Просмотреть файл

@ -1,20 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
/// <summary>
/// Defines values for IpsecIntegrity.
/// </summary>
public static class IpsecIntegrity
{
public const string MD5 = "MD5";
public const string SHA1 = "SHA1";
public const string SHA256 = "SHA256";
public const string GCMAES128 = "GCMAES128";
public const string GCMAES192 = "GCMAES192";
public const string GCMAES256 = "GCMAES256";
}
}

Просмотреть файл

@ -1,163 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
/// <summary>
/// An IPSec Policy configuration for a virtual network gateway connection
/// </summary>
public partial class IpsecPolicy
{
/// <summary>
/// Initializes a new instance of the IpsecPolicy class.
/// </summary>
public IpsecPolicy()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the IpsecPolicy class.
/// </summary>
/// <param name="saLifeTimeSeconds">The IPSec Security Association
/// (also called Quick Mode or Phase 2 SA) lifetime in seconds for a
/// site to site VPN tunnel.</param>
/// <param name="saDataSizeKilobytes">The IPSec Security Association
/// (also called Quick Mode or Phase 2 SA) payload size in KB for a
/// site to site VPN tunnel.</param>
/// <param name="ipsecEncryption">The IPSec encryption algorithm (IKE
/// phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128',
/// 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'</param>
/// <param name="ipsecIntegrity">The IPSec integrity algorithm (IKE
/// phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256',
/// 'GCMAES128', 'GCMAES192', 'GCMAES256'</param>
/// <param name="ikeEncryption">The IKE encryption algorithm (IKE phase
/// 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192',
/// 'AES256'</param>
/// <param name="ikeIntegrity">The IKE integrity algorithm (IKE phase
/// 2). Possible values include: 'MD5', 'SHA1', 'SHA256',
/// 'SHA384'</param>
/// <param name="dhGroup">The DH Groups used in IKE Phase 1 for initial
/// SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2',
/// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'</param>
/// <param name="pfsGroup">The DH Groups used in IKE Phase 2 for new
/// child SA. Possible values include: 'None', 'PFS1', 'PFS2',
/// 'PFS2048', 'ECP256', 'ECP384', 'PFS24'</param>
public IpsecPolicy(int saLifeTimeSeconds, int saDataSizeKilobytes, string ipsecEncryption, string ipsecIntegrity, string ikeEncryption, string ikeIntegrity, string dhGroup, string pfsGroup)
{
SaLifeTimeSeconds = saLifeTimeSeconds;
SaDataSizeKilobytes = saDataSizeKilobytes;
IpsecEncryption = ipsecEncryption;
IpsecIntegrity = ipsecIntegrity;
IkeEncryption = ikeEncryption;
IkeIntegrity = ikeIntegrity;
DhGroup = dhGroup;
PfsGroup = pfsGroup;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets the IPSec Security Association (also called Quick Mode
/// or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel.
/// </summary>
[JsonProperty(PropertyName = "saLifeTimeSeconds")]
public int SaLifeTimeSeconds { get; set; }
/// <summary>
/// Gets or sets the IPSec Security Association (also called Quick Mode
/// or Phase 2 SA) payload size in KB for a site to site VPN tunnel.
/// </summary>
[JsonProperty(PropertyName = "saDataSizeKilobytes")]
public int SaDataSizeKilobytes { get; set; }
/// <summary>
/// Gets or sets the IPSec encryption algorithm (IKE phase 1). Possible
/// values include: 'None', 'DES', 'DES3', 'AES128', 'AES192',
/// 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256'
/// </summary>
[JsonProperty(PropertyName = "ipsecEncryption")]
public string IpsecEncryption { get; set; }
/// <summary>
/// Gets or sets the IPSec integrity algorithm (IKE phase 1). Possible
/// values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192',
/// 'GCMAES256'
/// </summary>
[JsonProperty(PropertyName = "ipsecIntegrity")]
public string IpsecIntegrity { get; set; }
/// <summary>
/// Gets or sets the IKE encryption algorithm (IKE phase 2). Possible
/// values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256'
/// </summary>
[JsonProperty(PropertyName = "ikeEncryption")]
public string IkeEncryption { get; set; }
/// <summary>
/// Gets or sets the IKE integrity algorithm (IKE phase 2). Possible
/// values include: 'MD5', 'SHA1', 'SHA256', 'SHA384'
/// </summary>
[JsonProperty(PropertyName = "ikeIntegrity")]
public string IkeIntegrity { get; set; }
/// <summary>
/// Gets or sets the DH Groups used in IKE Phase 1 for initial SA.
/// Possible values include: 'None', 'DHGroup1', 'DHGroup2',
/// 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24'
/// </summary>
[JsonProperty(PropertyName = "dhGroup")]
public string DhGroup { get; set; }
/// <summary>
/// Gets or sets the DH Groups used in IKE Phase 2 for new child SA.
/// Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048',
/// 'ECP256', 'ECP384', 'PFS24'
/// </summary>
[JsonProperty(PropertyName = "pfsGroup")]
public string PfsGroup { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (IpsecEncryption == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "IpsecEncryption");
}
if (IpsecIntegrity == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "IpsecIntegrity");
}
if (IkeEncryption == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "IkeEncryption");
}
if (IkeIntegrity == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "IkeIntegrity");
}
if (DhGroup == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "DhGroup");
}
if (PfsGroup == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "PfsGroup");
}
}
}
}

Просмотреть файл

@ -1,21 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace applicationGateway.Models
{
/// <summary>
/// Defines values for PfsGroup.
/// </summary>
public static class PfsGroup
{
public const string None = "None";
public const string PFS1 = "PFS1";
public const string PFS2 = "PFS2";
public const string PFS2048 = "PFS2048";
public const string ECP256 = "ECP256";
public const string ECP384 = "ECP384";
public const string PFS24 = "PFS24";
}
}

Просмотреть файл

@ -1,164 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace tiny
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// CowbellOps operations.
/// </summary>
public partial class CowbellOps : IServiceOperations<CowbellFactory>, ICowbellOps
{
/// <summary>
/// Initializes a new instance of the CowbellOps class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public CowbellOps(CowbellFactory client)
{
if (client == null)
{
throw new System.ArgumentNullException("client");
}
Client = client;
}
/// <summary>
/// Gets a reference to the CowbellFactory
/// </summary>
public CowbellFactory Client { get; private set; }
/// <summary>
/// A good description.
/// </summary>
/// <param name='body'>
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse> AddWithHttpMessagesAsync(string body, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (body == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "body");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("body", body);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "cowbell").ToString();
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
if(body != null)
{
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Send Request
if (_shouldTrace)
{
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
if (_httpResponse.Content != null) {
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
}
else {
_responseContent = string.Empty;
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
}
}

Просмотреть файл

@ -1,46 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace tiny
{
using Models;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Extension methods for CowbellOps.
/// </summary>
public static partial class CowbellOpsExtensions
{
/// <summary>
/// A good description.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='body'>
/// </param>
public static void Add(this ICowbellOps operations, string body)
{
operations.AddAsync(body).GetAwaiter().GetResult();
}
/// <summary>
/// A good description.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='body'>
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task AddAsync(this ICowbellOps operations, string body, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.AddWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
}
}

Просмотреть файл

@ -1,38 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace tiny
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// CowbellOps operations.
/// </summary>
public partial interface ICowbellOps
{
/// <summary>
/// A good description.
/// </summary>
/// <param name='body'>
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse> AddWithHttpMessagesAsync(string body, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}

Просмотреть файл

@ -1,147 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace StreamWithContentType
{
using Microsoft.Rest;
using Microsoft.Rest.Serialization;
using Models;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
public partial class CowbellModerator : ServiceClient<CowbellModerator>, ICowbellModerator
{
/// <summary>
/// The base URI of the service.
/// </summary>
public System.Uri BaseUri { get; set; }
/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
public JsonSerializerSettings SerializationSettings { get; private set; }
/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
public JsonSerializerSettings DeserializationSettings { get; private set; }
/// <summary>
/// Gets the IImage.
/// </summary>
public virtual IImage Image { get; private set; }
/// <summary>
/// Initializes a new instance of the CowbellModerator class.
/// </summary>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
public CowbellModerator(params DelegatingHandler[] handlers) : base(handlers)
{
Initialize();
}
/// <summary>
/// Initializes a new instance of the CowbellModerator class.
/// </summary>
/// <param name='rootHandler'>
/// Optional. The http client handler used to handle http transport.
/// </param>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
public CowbellModerator(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
{
Initialize();
}
/// <summary>
/// Initializes a new instance of the CowbellModerator class.
/// </summary>
/// <param name='baseUri'>
/// Optional. The base URI of the service.
/// </param>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public CowbellModerator(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
BaseUri = baseUri;
}
/// <summary>
/// Initializes a new instance of the CowbellModerator class.
/// </summary>
/// <param name='baseUri'>
/// Optional. The base URI of the service.
/// </param>
/// <param name='rootHandler'>
/// Optional. The http client handler used to handle http transport.
/// </param>
/// <param name='handlers'>
/// Optional. The delegating handlers to add to the http client pipeline.
/// </param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public CowbellModerator(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
BaseUri = baseUri;
}
/// <summary>
/// An optional partial-method to perform custom initialization.
///</summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
private void Initialize()
{
Image = new Image(this);
BaseUri = new System.Uri("https://localhost");
SerializationSettings = new JsonSerializerSettings
{
Formatting = Newtonsoft.Json.Formatting.Indented,
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
ContractResolver = new ReadOnlyJsonContractResolver(),
Converters = new List<JsonConverter>
{
new Iso8601TimeSpanConverter()
}
};
DeserializationSettings = new JsonSerializerSettings
{
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
ContractResolver = new ReadOnlyJsonContractResolver(),
Converters = new List<JsonConverter>
{
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
}
}
}

Просмотреть файл

@ -1,36 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace StreamWithContentType
{
using Models;
using Newtonsoft.Json;
/// <summary>
/// </summary>
public partial interface ICowbellModerator : System.IDisposable
{
/// <summary>
/// The base URI of the service.
/// </summary>
System.Uri BaseUri { get; set; }
/// <summary>
/// Gets or sets json serialization settings.
/// </summary>
JsonSerializerSettings SerializationSettings { get; }
/// <summary>
/// Gets or sets json deserialization settings.
/// </summary>
JsonSerializerSettings DeserializationSettings { get; }
/// <summary>
/// Gets the IImage.
/// </summary>
IImage Image { get; }
}
}

Просмотреть файл

@ -1,61 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace StreamWithContentType
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Image operations.
/// </summary>
public partial interface IImage
{
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include:
/// 'image/gif', 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse> AWithHttpMessagesAsync(Stream image, ContentType? imageContentType = default(ContentType?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include:
/// 'image/gif', 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse> BWithHttpMessagesAsync(Stream image, ContentType imageContentType, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}

Просмотреть файл

@ -1,294 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace StreamWithContentType
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Image operations.
/// </summary>
public partial class Image : IServiceOperations<CowbellModerator>, IImage
{
/// <summary>
/// Initializes a new instance of the Image class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
public Image(CowbellModerator client)
{
if (client == null)
{
throw new System.ArgumentNullException("client");
}
Client = client;
}
/// <summary>
/// Gets a reference to the CowbellModerator
/// </summary>
public CowbellModerator Client { get; private set; }
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include: 'image/gif',
/// 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse> AWithHttpMessagesAsync(Stream image, ContentType? imageContentType = default(ContentType?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (image == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "image");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("image", image);
tracingParameters.Add("imageContentType", imageContentType);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "A", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "ProcessImage/FunctionA").ToString();
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
if(image == null)
{
throw new System.ArgumentNullException("image");
}
if (image != null && image != Stream.Null)
{
_httpRequest.Content = new StreamContent(image);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse(imageContentType.ToSerializedValue());
}
// Send Request
if (_shouldTrace)
{
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
if (_httpResponse.Content != null) {
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
}
else {
_responseContent = string.Empty;
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include: 'image/gif',
/// 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="HttpOperationException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse> BWithHttpMessagesAsync(Stream image, ContentType imageContentType, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (image == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "image");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("image", image);
tracingParameters.Add("imageContentType", imageContentType);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "B", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "ProcessImage/FunctionB").ToString();
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
if(image == null)
{
throw new System.ArgumentNullException("image");
}
if (image != null && image != Stream.Null)
{
_httpRequest.Content = new StreamContent(image);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse(imageContentType.ToSerializedValue());
}
// Send Request
if (_shouldTrace)
{
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
if (_httpResponse.Content != null) {
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
}
else {
_responseContent = string.Empty;
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_shouldTrace)
{
ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;
}
}
}

Просмотреть файл

@ -1,84 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace StreamWithContentType
{
using Models;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Extension methods for Image.
/// </summary>
public static partial class ImageExtensions
{
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include: 'image/gif',
/// 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
public static void A(this IImage operations, Stream image, ContentType? imageContentType = default(ContentType?))
{
operations.AAsync(image, imageContentType).GetAwaiter().GetResult();
}
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include: 'image/gif',
/// 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task AAsync(this IImage operations, Stream image, ContentType? imageContentType = default(ContentType?), CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.AWithHttpMessagesAsync(image, imageContentType, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include: 'image/gif',
/// 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
public static void B(this IImage operations, Stream image, ContentType imageContentType)
{
operations.BAsync(image, imageContentType).GetAwaiter().GetResult();
}
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='image'>
/// An image stream.
/// </param>
/// <param name='imageContentType'>
/// The content type of the image. Possible values include: 'image/gif',
/// 'image/jpeg', 'image/png', 'image/bmp', 'image/tiff'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task BAsync(this IImage operations, Stream image, ContentType imageContentType, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.BWithHttpMessagesAsync(image, imageContentType, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
}
}

Просмотреть файл

@ -1,69 +0,0 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace StreamWithContentType.Models
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime;
using System.Runtime.Serialization;
/// <summary>
/// Defines values for ContentType.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ContentType
{
[EnumMember(Value = "image/gif")]
ImageGif,
[EnumMember(Value = "image/jpeg")]
ImageJpeg,
[EnumMember(Value = "image/png")]
ImagePng,
[EnumMember(Value = "image/bmp")]
ImageBmp,
[EnumMember(Value = "image/tiff")]
ImageTiff
}
internal static class ContentTypeEnumExtension
{
internal static string ToSerializedValue(this ContentType? value ) =>
value == null ? null : (( ContentType )value).ToSerializedValue();
internal static string ToSerializedValue(this ContentType value )
{
switch( value )
{
case ContentType.ImageGif:
return "image/gif";
case ContentType.ImageJpeg:
return "image/jpeg";
case ContentType.ImagePng:
return "image/png";
case ContentType.ImageBmp:
return "image/bmp";
case ContentType.ImageTiff:
return "image/tiff";
}
return null;
}
internal static ContentType? ParseContentType( this string value )
{
switch( value )
{
case "image/gif":
return ContentType.ImageGif;
case "image/jpeg":
return ContentType.ImageJpeg;
case "image/png":
return ContentType.ImagePng;
case "image/bmp":
return ContentType.ImageBmp;
case "image/tiff":
return ContentType.ImageTiff; }
return null;
}
}
}

Просмотреть файл

@ -231,21 +231,6 @@ namespace AutoRest.Core.Model
/// </summary>
public bool Hidden { get; set; }
/// <summary>
/// Determines whether the specified method is structurally equal to this object.
/// </summary>
/// <param name="other">The object to compare with this object.</param>
public bool StructurallyEquals(Method other)
{
if (other == null)
{
return false;
}
return ReturnType.StructurallyEquals(other.ReturnType)
&& Name.Equals(other.Name)
&& Parameters.SequenceEqual(other.Parameters, new Utilities.EqualityComparer<Parameter>((a, b) => a.StructurallyEquals(b)));
}
[JsonIgnore]
public IEnumerable<string> MyReservedNames => Name.Value.SingleItemAsEnumerable();

Просмотреть файл

@ -68,20 +68,6 @@ namespace AutoRest.Core.Model
/// </summary>
public virtual ParameterLocation Location { get; set; }
/// <summary>
/// Determines whether the specified parameter is structurally equal to this object.
/// </summary>
/// <param name="other">The object to compare with this object.</param>
public bool StructurallyEquals(Parameter other)
{
if (other == null)
{
return false;
}
return ModelType.StructurallyEquals(other.ModelType)
&& Name.Equals(other.Name);
}
[JsonIgnore]
public override IParent Parent
{

Просмотреть файл

@ -37,19 +37,6 @@ namespace AutoRest.Core.Model
/// </summary>
public IModelType Headers { get; set; }
/// <summary>
/// Determines whether the specified response is structurally equal to this object.
/// </summary>
/// <param name="other">The object to compare with this object.</param>
public bool StructurallyEquals(Response other)
{
if (other == null)
{
return false;
}
return (Body == null ? other.Body == null : Body.StructurallyEquals(other.Body))
&& (Headers == null ? other.Headers == null : Headers.StructurallyEquals(other.Headers));
}
public Dictionary<string, object> Extensions { get; set; } = new Dictionary<string, object>();
public bool IsNullable => Extensions?.Get<bool>("x-nullable") ?? true;

Просмотреть файл

@ -682,12 +682,16 @@ task 'regenerate-delete', '', (done)->
'src/generator/AutoRest.Python.Tests/Expected'
'src/generator/AutoRest.Python.Azure.Tests/Expected'
'src/generator/AutoRest.AzureResourceSchema.Tests/Resource/Expected'
source 'Samples/*/**/'
rmQueue = [] # buffered, since piped removal will cause `source` to fail midway (ENOENT)
source 'Samples/*/*/**/'
.pipe foreach (each, next) ->
configFile = path.join(each.path, "../readme.md")
console.log "rm -rf #{each.path}" if fs.existsSync configFile
rm "-rf", '#{each.path}' if fs.existsSync configFile
rmQueue.push each.path if fs.existsSync configFile
next null
.on 'end', ->
for folder in rmQueue
console.log "rm -rf #{folder}"
rm "-rf", "#{folder}"
task 'autorest-preview-build', '', ->
exec "dotnet build #{basefolder}/src/dev/AutoRest.Preview/"