From 9160423267f90755430d156bd94eaebd5df485ab Mon Sep 17 00:00:00 2001 From: dnaumov Date: Thu, 23 Sep 2021 13:34:14 -0400 Subject: [PATCH] Prepare the project for publishing as NugetPackage --- Acumatica REST API Client.sln | 7 - .../Acumatica.RESTClient.csproj | 24 +- Acumatica.RESTClient/AcumaticaApi/AuthApi.cs | 179 ++++++++ .../{Api => AcumaticaApi}/FileApi.cs | 0 Acumatica.RESTClient/AcumaticaApi/RootApi.cs | 105 +++++ .../{Api => BaseApi}/BaseApi.cs | 434 +++++++++--------- .../EntityAPI_Implementation.cs | 0 .../{Api => BaseApi}/EntityAPI_Public.cs | 0 Acumatica.RESTClient/Client/ApiClient.cs | 2 +- Acumatica.RESTClient/Model/Credentials.cs | 225 +++++++++ Acumatica.RESTClient/Model/Endpoint.cs | 156 +++++++ .../Model/{ => EntityBase}/Entity.cs | 0 .../Model/{ => EntityBase}/EntityAction.cs | 0 .../EntityActionWithParameters.cs | 0 .../Model/{ => EntityBase}/Entity_v3.cs | 0 .../Model/{ => EntityBase}/Entity_v4.cs | 0 Acumatica.RESTClient/Model/Version.cs | 156 +++++++ .../Model/VersionAndEndpoints.cs | 140 ++++++ .../Properties/AssemblyInfo.cs | 11 +- 19 files changed, 1200 insertions(+), 239 deletions(-) create mode 100644 Acumatica.RESTClient/AcumaticaApi/AuthApi.cs rename Acumatica.RESTClient/{Api => AcumaticaApi}/FileApi.cs (100%) create mode 100644 Acumatica.RESTClient/AcumaticaApi/RootApi.cs rename Acumatica.RESTClient/{Api => BaseApi}/BaseApi.cs (97%) rename Acumatica.RESTClient/{Api => BaseApi}/EntityAPI_Implementation.cs (100%) rename Acumatica.RESTClient/{Api => BaseApi}/EntityAPI_Public.cs (100%) create mode 100644 Acumatica.RESTClient/Model/Credentials.cs create mode 100644 Acumatica.RESTClient/Model/Endpoint.cs rename Acumatica.RESTClient/Model/{ => EntityBase}/Entity.cs (100%) rename Acumatica.RESTClient/Model/{ => EntityBase}/EntityAction.cs (100%) rename Acumatica.RESTClient/Model/{ => EntityBase}/EntityActionWithParameters.cs (100%) rename Acumatica.RESTClient/Model/{ => EntityBase}/Entity_v3.cs (100%) rename Acumatica.RESTClient/Model/{ => EntityBase}/Entity_v4.cs (100%) create mode 100644 Acumatica.RESTClient/Model/Version.cs create mode 100644 Acumatica.RESTClient/Model/VersionAndEndpoints.cs diff --git a/Acumatica REST API Client.sln b/Acumatica REST API Client.sln index 1f44913c..2c3fb109 100644 --- a/Acumatica REST API Client.sln +++ b/Acumatica REST API Client.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.29503.13 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acumatica REST API Example Console Application", "Acumatica REST API Console Application\Acumatica REST API Example Console Application.csproj", "{201508E8-B057-4EFB-AD9D-74C777339C42}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acumatica.Auth", "Acumatica.Auth\Acumatica.Auth.csproj", "{5B17772D-1F76-4A4B-A3F7-8C8CFFA93E29}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acumatica.RESTClient", "Acumatica.RESTClient\Acumatica.RESTClient.csproj", "{25008D3F-3D78-4BB9-B14B-0A792AE97892}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SOAPLikeWrapperForREST", "SOAPLikeWrapperForREST\SOAPLikeWrapperForREST.csproj", "{99541823-473A-46E8-AEC0-CE6250F00FE8}" @@ -45,10 +43,6 @@ Global {201508E8-B057-4EFB-AD9D-74C777339C42}.Debug|Any CPU.Build.0 = Debug|Any CPU {201508E8-B057-4EFB-AD9D-74C777339C42}.Release|Any CPU.ActiveCfg = Release|Any CPU {201508E8-B057-4EFB-AD9D-74C777339C42}.Release|Any CPU.Build.0 = Release|Any CPU - {5B17772D-1F76-4A4B-A3F7-8C8CFFA93E29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5B17772D-1F76-4A4B-A3F7-8C8CFFA93E29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B17772D-1F76-4A4B-A3F7-8C8CFFA93E29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5B17772D-1F76-4A4B-A3F7-8C8CFFA93E29}.Release|Any CPU.Build.0 = Release|Any CPU {25008D3F-3D78-4BB9-B14B-0A792AE97892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {25008D3F-3D78-4BB9-B14B-0A792AE97892}.Debug|Any CPU.Build.0 = Debug|Any CPU {25008D3F-3D78-4BB9-B14B-0A792AE97892}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -106,7 +100,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {5B17772D-1F76-4A4B-A3F7-8C8CFFA93E29} = {F0B2BD45-79AE-43AF-B737-3018CD95C6E3} {4FDDE01D-C802-4E52-9458-B614B1C8EFAB} = {F0B2BD45-79AE-43AF-B737-3018CD95C6E3} {638D4F3F-4496-44DC-8BAA-6C0F05516A22} = {F0B2BD45-79AE-43AF-B737-3018CD95C6E3} {8F2FDE89-9542-487F-AFD9-40DA3704DF92} = {F0B2BD45-79AE-43AF-B737-3018CD95C6E3} diff --git a/Acumatica.RESTClient/Acumatica.RESTClient.csproj b/Acumatica.RESTClient/Acumatica.RESTClient.csproj index 9856da91..a7d0ea1b 100644 --- a/Acumatica.RESTClient/Acumatica.RESTClient.csproj +++ b/Acumatica.RESTClient/Acumatica.RESTClient.csproj @@ -59,24 +59,28 @@ OpenAPI spec version: 3 - - - + + + + + - + - - - - - + + + + + + + @@ -101,6 +105,8 @@ OpenAPI spec version: 3 + + diff --git a/Acumatica.RESTClient/AcumaticaApi/AuthApi.cs b/Acumatica.RESTClient/AcumaticaApi/AuthApi.cs new file mode 100644 index 00000000..9ac190da --- /dev/null +++ b/Acumatica.RESTClient/AcumaticaApi/AuthApi.cs @@ -0,0 +1,179 @@ +using Acumatica.Auth.Model; +using Acumatica.RESTClient.Api; +using Acumatica.RESTClient.Client; +using RestSharp; +using System; +using System.Net; + + +namespace Acumatica.Auth.Api +{ + /// + /// Represents a collection of functions to interact with the Authorization endpoint + /// + public partial class AuthApi : BaseApi + { + #region Constructor + /// + /// Initializes a new instance of the class. + /// + /// + public AuthApi(String basePath) : base(basePath) + { } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public AuthApi(Configuration configuration) : base(configuration) + { } + #endregion + + #region Public Methods + public Configuration LogIn(string username, string password, string tenant = null, string branch = null, string locale = null) + { + var cookieContainer = new CookieContainer(); + this.Configuration.ApiClient.RestClient.CookieContainer = cookieContainer; + + this.AuthLogin(new Credentials(username, password, tenant, branch, locale)); + // Console.WriteLine("Logged In..."); + var configuration = new Configuration(this.Configuration.BasePath); + + //share cookie container between API clients because we use different client for authentication and interaction with endpoint + configuration.ApiClient.RestClient.CookieContainer = this.Configuration.ApiClient.RestClient.CookieContainer; + return configuration; + } + /// + /// Logs in to the system. + /// + /// Thrown when fails to make API call + /// + /// + public void AuthLogin(Credentials credentials) + { + AuthLoginWithHttpInfo(credentials); + } + /// + /// Logs in to the system. + /// + /// Thrown when fails to make API call + /// + /// Task of void + public async System.Threading.Tasks.Task AuthLoginAsync(Credentials credentials) + { + await AuthLoginAsyncWithHttpInfo(credentials); + + } + + /// + /// Logs out from the system. + /// + /// Thrown when fails to make API call + /// + public void AuthLogout() + { + AuthLogoutWithHttpInfo(); + } + /// + /// Logs out from the system. + /// + /// Thrown when fails to make API call + /// Task of void + public async System.Threading.Tasks.Task AuthLogoutAsync() + { + await AuthLogoutAsyncWithHttpInfo(); + + } + #endregion + + #region Implementation + /// + /// Logs in to the system. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + protected ApiResponse AuthLoginWithHttpInfo(Credentials credentials) + { + // verify the required parameter 'credentials' is set + if (credentials == null) + ThrowMissingParameter("AuthLogin", nameof(credentials)); + + var localVarPath = "/entity/auth/login"; + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, ComposeEmptyQueryParams(), ComposeBody(credentials), ComposeAcceptHeaders(HeaderContentType.None), ComposeEmptyFormParams(), ComposeEmptyFileParams(), + ComposeEmptyPathParams(), ComposeContentHeaders(HeaderContentType.Json | HeaderContentType.Xml | HeaderContentType.WwwForm)); + + VerifyResponse(localVarResponse, "AuthLogin"); + + return GetResponseHeaders(localVarResponse); + } + + /// + /// Logs in to the system. + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse + protected async System.Threading.Tasks.Task> AuthLoginAsyncWithHttpInfo(Credentials credentials) + { + // verify the required parameter 'credentials' is set + if (credentials == null) + ThrowMissingParameter("AuthLogin", nameof(credentials)); + + var localVarPath = "/entity/auth/login"; + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, ComposeEmptyQueryParams(), ComposeBody(credentials), ComposeAcceptHeaders(HeaderContentType.None), ComposeEmptyFormParams(), ComposeEmptyFileParams(), + ComposeEmptyPathParams(), ComposeContentHeaders(HeaderContentType.Json | HeaderContentType.Xml | HeaderContentType.WwwForm)); + + VerifyResponse(localVarResponse, "AuthLogin"); + + return GetResponseHeaders(localVarResponse); + } + + /// + /// Logs out from the system. + /// + /// Thrown when fails to make API call + /// ApiResponse of Object(void) + protected ApiResponse AuthLogoutWithHttpInfo() + { + var localVarPath = "/entity/auth/logout"; + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, ComposeEmptyQueryParams(), null, ComposeAcceptHeaders(HeaderContentType.None), ComposeEmptyFormParams(), ComposeEmptyFileParams(), + ComposeEmptyPathParams(), ComposeContentHeaders(HeaderContentType.None)); + + VerifyResponse(localVarResponse, "AuthLogout"); + + return GetResponseHeaders(localVarResponse); + } + + /// + /// Logs out from the system. + /// + /// Thrown when fails to make API call + /// Task of ApiResponse + protected async System.Threading.Tasks.Task> AuthLogoutAsyncWithHttpInfo() + { + var localVarPath = "/entity/auth/logout"; + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, ComposeEmptyQueryParams(), null, ComposeAcceptHeaders(HeaderContentType.None), ComposeEmptyFormParams(), ComposeEmptyFileParams(), + ComposeEmptyPathParams(), ComposeContentHeaders(HeaderContentType.None)); + + VerifyResponse(localVarResponse, "AuthLogout"); + + return GetResponseHeaders(localVarResponse); + } + #endregion + } +} diff --git a/Acumatica.RESTClient/Api/FileApi.cs b/Acumatica.RESTClient/AcumaticaApi/FileApi.cs similarity index 100% rename from Acumatica.RESTClient/Api/FileApi.cs rename to Acumatica.RESTClient/AcumaticaApi/FileApi.cs diff --git a/Acumatica.RESTClient/AcumaticaApi/RootApi.cs b/Acumatica.RESTClient/AcumaticaApi/RootApi.cs new file mode 100644 index 00000000..229c3e28 --- /dev/null +++ b/Acumatica.RESTClient/AcumaticaApi/RootApi.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp; +using Acumatica.RESTClient.Client; +using Acumatica.Auth.Model; +using Acumatica.RESTClient.Api; + +namespace Acumatica.Auth.Api +{ + + /// + /// Represents a collection of functions to interact with the API endpoints + /// + public partial class RootApi : BaseApi + { + #region Constructor + /// + /// Initializes a new instance of the class. + /// + /// + public RootApi(String basePath) : base(basePath) + { } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public RootApi(Configuration configuration) : base(configuration) + { } + #endregion + + #region Public Methods + + /// + /// Returns the version of the Acumatica ERP instance and the endpoints available in this instance. + /// Available stating from 2019 R2 version of Acumatica ERP. + /// + /// Thrown when fails to make API call + /// VersionAndEndpoints + public VersionAndEndpoints RootGet() + { + ApiResponse localVarResponse = RootGetWithHttpInfo(); + return localVarResponse.Data; + } + /// + /// Returns the version of the Acumatica ERP instance and the endpoints available in this instance. + /// Available stating from 2019 R2 version of Acumatica ERP. + /// + /// Thrown when fails to make API call + /// Task of VersionAndEndpoints + public async System.Threading.Tasks.Task RootGetAsync() + { + ApiResponse localVarResponse = await RootGetAsyncWithHttpInfo(); + return localVarResponse.Data; + + } + #endregion + + #region Implementation + /// + /// Returns the version of the Acumatica ERP instance and the endpoints available in this instance. + /// Available stating from 2019 R2 version of Acumatica ERP. + /// + /// Thrown when fails to make API call + /// ApiResponse of VersionAndEndpoints + protected ApiResponse RootGetWithHttpInfo() + { + var localVarPath = "/entity"; + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath, + Method.GET, ComposeEmptyQueryParams(), null, ComposeAcceptHeaders(HeaderContentType.Xml | HeaderContentType.Json), ComposeEmptyFormParams(), ComposeEmptyFileParams(), + ComposeEmptyPathParams(), ComposeContentHeaders(HeaderContentType.None)); + + VerifyResponse(localVarResponse, "RootGet"); + + return DeserializeResponse(localVarResponse); + } + + /// + /// Returns the version of the Acumatica ERP instance and the endpoints available in this instance. + /// Available stating from 2019 R2 version of Acumatica ERP. + /// + /// Thrown when fails to make API call + /// Task of ApiResponse (VersionAndEndpoints) + protected async System.Threading.Tasks.Task> RootGetAsyncWithHttpInfo() + { + var localVarPath = "/entity"; + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.GET, ComposeEmptyQueryParams(), null, ComposeAcceptHeaders(HeaderContentType.Json | HeaderContentType.Xml), ComposeEmptyFormParams(), ComposeEmptyFileParams(), + ComposeEmptyPathParams(), ComposeContentHeaders(HeaderContentType.None)); + + VerifyResponse(localVarResponse, "RootGet"); + + return DeserializeResponse(localVarResponse); + } + #endregion + } +} diff --git a/Acumatica.RESTClient/Api/BaseApi.cs b/Acumatica.RESTClient/BaseApi/BaseApi.cs similarity index 97% rename from Acumatica.RESTClient/Api/BaseApi.cs rename to Acumatica.RESTClient/BaseApi/BaseApi.cs index 58034399..63f50baa 100644 --- a/Acumatica.RESTClient/Api/BaseApi.cs +++ b/Acumatica.RESTClient/BaseApi/BaseApi.cs @@ -1,218 +1,218 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using RestSharp; -using Acumatica.RESTClient.Client; -using System.Threading; -using Acumatica.RESTClient.Model; - -namespace Acumatica.RESTClient.Api -{ - /// - /// Represents a base class with common logic for all Api classes. - /// - public abstract class BaseApi : IApiAccessor - { - #region Constructor - - /// - /// Initializes a new instance of the class. - /// - /// - public BaseApi(String basePath) - { - this.Configuration = new Configuration(basePath); - - ExceptionFactory = Configuration.DefaultExceptionFactory; - } - - /// - /// Initializes a new instance of the class - /// using Configuration object - /// - /// An instance of Configuration - /// - public BaseApi(Configuration configuration) - { - if (configuration == null) - { - throw new ArgumentNullException(nameof(configuration)); - } - this.Configuration = configuration; - - ExceptionFactory = Configuration.DefaultExceptionFactory; - } - #endregion - - #region Implementation - /// - /// Gets the base path of the API client. - /// - /// The base path - public String GetBasePath() - { - return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); - } - private const string ApplicationJsonAcceptContentType = "application/json"; - private const string TextJsonAcceptContentType = "text/json"; - private const string ApplicationXmlAcceptContentType = "application/xml"; - private const string TextXmlAcceptContentType = "text/xml"; - private const string WwwFormEncoded = "application/x-www-form-urlencoded"; - private const string OctetStream = "application/octet-stream"; - private const string AnyAcceptContentType = "*/*"; - [Flags] - protected enum HeaderContentType : short - { - None = 0, - Json = 1, - Xml = 2, - Any = 4, - WwwForm = 8, - OctetStream = 16 - }; - protected string ComposeContentHeaders(HeaderContentType contentTypes) - { - // to determine the Content-Type header - string[] localVarHttpContentTypes = ComposeHeadersArray(contentTypes); - return this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - } - protected Dictionary ComposeAcceptHeaders(HeaderContentType contentTypes) - { - var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); - // to determine the Accept header - string[] localVarHttpHeaderAccepts = ComposeHeadersArray(contentTypes); - String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - return localVarHeaderParams; - } - - private static string[] ComposeHeadersArray(HeaderContentType contentTypes) - { - List headers = new List(); - if ((contentTypes & HeaderContentType.Json) == HeaderContentType.Json) - { - headers.Add(ApplicationJsonAcceptContentType); - headers.Add(TextJsonAcceptContentType); - } - if ((contentTypes & HeaderContentType.Xml) == HeaderContentType.Xml) - { - headers.Add(ApplicationXmlAcceptContentType); - headers.Add(TextXmlAcceptContentType); - } - if ((contentTypes & HeaderContentType.Any) == HeaderContentType.Any) - { - headers.Add(AnyAcceptContentType); - } - if ((contentTypes & HeaderContentType.WwwForm) == HeaderContentType.WwwForm) - { - headers.Add(WwwFormEncoded); - } - - if ((contentTypes & HeaderContentType.OctetStream) == HeaderContentType.OctetStream) - { - headers.Add(OctetStream); - } - String[] localVarHttpHeaderAccepts = headers.ToArray(); - return localVarHttpHeaderAccepts; - } - - /// - /// Gets or sets the configuration object - /// - /// An instance of the Configuration - public Configuration Configuration { get; set; } - - /// - /// Provides a factory method hook for the creation of exceptions. - /// - public ExceptionFactory ExceptionFactory - { - get - { - if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) - { - throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); - } - return _exceptionFactory; - } - set { _exceptionFactory = value; } - } - protected Dictionary ComposeEmptyFileParams() - { - return new Dictionary(); - } - protected List> ComposeEmptyQueryParams() - { - return new List>(); - } - protected Dictionary ComposeEmptyPathParams() - { - return new Dictionary(); - } - protected Dictionary ComposeEmptyFormParams() - { - return new Dictionary(); - } - protected object ComposeBody(object objectForRequestBody) - { - object postBody = null; - - if (objectForRequestBody != null && objectForRequestBody.GetType() != typeof(byte[])) - { +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using RestSharp; +using Acumatica.RESTClient.Client; +using System.Threading; +using Acumatica.RESTClient.Model; + +namespace Acumatica.RESTClient.Api +{ + /// + /// Represents a base class with common logic for all Api classes. + /// + public abstract class BaseApi : IApiAccessor + { + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + /// + public BaseApi(String basePath) + { + this.Configuration = new Configuration(basePath); + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + + /// + /// Initializes a new instance of the class + /// using Configuration object + /// + /// An instance of Configuration + /// + public BaseApi(Configuration configuration) + { + if (configuration == null) + { + throw new ArgumentNullException(nameof(configuration)); + } + this.Configuration = configuration; + + ExceptionFactory = Configuration.DefaultExceptionFactory; + } + #endregion + + #region Implementation + /// + /// Gets the base path of the API client. + /// + /// The base path + public String GetBasePath() + { + return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); + } + private const string ApplicationJsonAcceptContentType = "application/json"; + private const string TextJsonAcceptContentType = "text/json"; + private const string ApplicationXmlAcceptContentType = "application/xml"; + private const string TextXmlAcceptContentType = "text/xml"; + private const string WwwFormEncoded = "application/x-www-form-urlencoded"; + private const string OctetStream = "application/octet-stream"; + private const string AnyAcceptContentType = "*/*"; + [Flags] + protected enum HeaderContentType : short + { + None = 0, + Json = 1, + Xml = 2, + Any = 4, + WwwForm = 8, + OctetStream = 16 + }; + protected string ComposeContentHeaders(HeaderContentType contentTypes) + { + // to determine the Content-Type header + string[] localVarHttpContentTypes = ComposeHeadersArray(contentTypes); + return this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + } + protected Dictionary ComposeAcceptHeaders(HeaderContentType contentTypes) + { + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + // to determine the Accept header + string[] localVarHttpHeaderAccepts = ComposeHeadersArray(contentTypes); + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + return localVarHeaderParams; + } + + private static string[] ComposeHeadersArray(HeaderContentType contentTypes) + { + List headers = new List(); + if ((contentTypes & HeaderContentType.Json) == HeaderContentType.Json) + { + headers.Add(ApplicationJsonAcceptContentType); + headers.Add(TextJsonAcceptContentType); + } + if ((contentTypes & HeaderContentType.Xml) == HeaderContentType.Xml) + { + headers.Add(ApplicationXmlAcceptContentType); + headers.Add(TextXmlAcceptContentType); + } + if ((contentTypes & HeaderContentType.Any) == HeaderContentType.Any) + { + headers.Add(AnyAcceptContentType); + } + if ((contentTypes & HeaderContentType.WwwForm) == HeaderContentType.WwwForm) + { + headers.Add(WwwFormEncoded); + } + + if ((contentTypes & HeaderContentType.OctetStream) == HeaderContentType.OctetStream) + { + headers.Add(OctetStream); + } + String[] localVarHttpHeaderAccepts = headers.ToArray(); + return localVarHttpHeaderAccepts; + } + + /// + /// Gets or sets the configuration object + /// + /// An instance of the Configuration + public Configuration Configuration { get; set; } + + /// + /// Provides a factory method hook for the creation of exceptions. + /// + public ExceptionFactory ExceptionFactory + { + get + { + if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) + { + throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); + } + return _exceptionFactory; + } + set { _exceptionFactory = value; } + } + protected Dictionary ComposeEmptyFileParams() + { + return new Dictionary(); + } + protected List> ComposeEmptyQueryParams() + { + return new List>(); + } + protected Dictionary ComposeEmptyPathParams() + { + return new Dictionary(); + } + protected Dictionary ComposeEmptyFormParams() + { + return new Dictionary(); + } + protected object ComposeBody(object objectForRequestBody) + { + object postBody = null; + + if (objectForRequestBody != null && objectForRequestBody.GetType() != typeof(byte[])) + { postBody = this.Configuration.ApiClient.Serialize(objectForRequestBody); // http body (model) parameter - } - else - { - postBody = objectForRequestBody; // byte array - } - - return postBody; - } - protected ApiResponse DeserializeResponse(IRestResponse response) - { - int localVarStatusCode = (int)response.StatusCode; - - return new ApiResponse(localVarStatusCode, - response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (T)this.Configuration.ApiClient.Deserialize(response, typeof(T))); - } - - protected ApiResponse GetResponseHeaders(IRestResponse response) - { - int localVarStatusCode = (int)response.StatusCode; - - return new ApiResponse(localVarStatusCode, - response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - null); - } - - protected void VerifyResponse(IRestResponse response, string methodName) - { - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory(methodName, response, typeof(T)); - if (exception != null) throw exception; - } - } - - protected void VerifyResponse(IRestResponse response, string methodName) - { - if (ExceptionFactory != null) - { - Exception exception = ExceptionFactory(methodName, response, null); - if (exception != null) throw exception; - } - } - - protected void ThrowMissingParameter(string methodName, string paramName) - { - throw new ApiException(400, $"Missing required parameter '{paramName}' when calling {methodName}"); - } - - protected ExceptionFactory _exceptionFactory = (name, response, type) => null; - - #endregion - } -} + } + else + { + postBody = objectForRequestBody; // byte array + } + + return postBody; + } + protected ApiResponse DeserializeResponse(IRestResponse response) + { + int localVarStatusCode = (int)response.StatusCode; + + return new ApiResponse(localVarStatusCode, + response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (T)this.Configuration.ApiClient.Deserialize(response, typeof(T))); + } + + protected ApiResponse GetResponseHeaders(IRestResponse response) + { + int localVarStatusCode = (int)response.StatusCode; + + return new ApiResponse(localVarStatusCode, + response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + null); + } + + protected void VerifyResponse(IRestResponse response, string methodName) + { + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory(methodName, response, typeof(T)); + if (exception != null) throw exception; + } + } + + protected void VerifyResponse(IRestResponse response, string methodName) + { + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory(methodName, response, null); + if (exception != null) throw exception; + } + } + + protected void ThrowMissingParameter(string methodName, string paramName) + { + throw new ApiException(400, $"Missing required parameter '{paramName}' when calling {methodName}"); + } + + protected ExceptionFactory _exceptionFactory = (name, response, type) => null; + + #endregion + } +} diff --git a/Acumatica.RESTClient/Api/EntityAPI_Implementation.cs b/Acumatica.RESTClient/BaseApi/EntityAPI_Implementation.cs similarity index 100% rename from Acumatica.RESTClient/Api/EntityAPI_Implementation.cs rename to Acumatica.RESTClient/BaseApi/EntityAPI_Implementation.cs diff --git a/Acumatica.RESTClient/Api/EntityAPI_Public.cs b/Acumatica.RESTClient/BaseApi/EntityAPI_Public.cs similarity index 100% rename from Acumatica.RESTClient/Api/EntityAPI_Public.cs rename to Acumatica.RESTClient/BaseApi/EntityAPI_Public.cs diff --git a/Acumatica.RESTClient/Client/ApiClient.cs b/Acumatica.RESTClient/Client/ApiClient.cs index 37881670..75ea2819 100644 --- a/Acumatica.RESTClient/Client/ApiClient.cs +++ b/Acumatica.RESTClient/Client/ApiClient.cs @@ -133,7 +133,7 @@ public Object CallApi( String path, RestSharp.Method method, List> queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, - String contentType, bool logRequests = true, bool logResponse = true) + String contentType, bool logRequests = false, bool logResponse = false) { var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, diff --git a/Acumatica.RESTClient/Model/Credentials.cs b/Acumatica.RESTClient/Model/Credentials.cs new file mode 100644 index 00000000..9ae2e332 --- /dev/null +++ b/Acumatica.RESTClient/Model/Credentials.cs @@ -0,0 +1,225 @@ +/* + * Some version + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Acumatica.RESTClient.Client.OpenAPIDateConverter; + +namespace Acumatica.Auth.Model +{ + /// + /// Credentials + /// + [DataContract] + public partial class Credentials : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Credentials() { } + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// password (required). + /// company. + /// tenant. + /// branch. + /// locale. + public Credentials(string name = default(string), string password = default(string), string company = default(string), string tenant = default(string), string branch = default(string), string locale = default(string)) + { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Credentials and cannot be null"); + } + else + { + this.Name = name; + } + // to ensure "password" is required (not null) + if (password == null) + { + throw new InvalidDataException("password is a required property for Credentials and cannot be null"); + } + else + { + this.Password = password; + } + this.Company = company; + this.Tenant = tenant; + this.Branch = branch; + this.Locale = locale; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name = "password", EmitDefaultValue = false)] + public string Password { get; set; } + + /// + /// Gets or Sets Company + /// + [DataMember(Name = "company", EmitDefaultValue = false)] + public string Company { get; set; } + + /// + /// Gets or Sets Tenant + /// + [DataMember(Name = "tenant", EmitDefaultValue = false)] + public string Tenant { get; set; } + + /// + /// Gets or Sets Branch + /// + [DataMember(Name = "branch", EmitDefaultValue = false)] + public string Branch { get; set; } + + /// + /// Gets or Sets Locale + /// + [DataMember(Name = "locale", EmitDefaultValue = false)] + public string Locale { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Credentials {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" Company: ").Append(Company).Append("\n"); + sb.Append(" Tenant: ").Append(Tenant).Append("\n"); + sb.Append(" Branch: ").Append(Branch).Append("\n"); + sb.Append(" Locale: ").Append(Locale).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Credentials); + } + + /// + /// Returns true if Credentials instances are equal + /// + /// Instance of Credentials to be compared + /// Boolean + public bool Equals(Credentials input) + { + if (input == null) + return false; + + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Password == input.Password || + (this.Password != null && + this.Password.Equals(input.Password)) + ) && + ( + this.Company == input.Company || + (this.Company != null && + this.Company.Equals(input.Company)) + ) && + ( + this.Tenant == input.Tenant || + (this.Tenant != null && + this.Tenant.Equals(input.Tenant)) + ) && + ( + this.Branch == input.Branch || + (this.Branch != null && + this.Branch.Equals(input.Branch)) + ) && + ( + this.Locale == input.Locale || + (this.Locale != null && + this.Locale.Equals(input.Locale)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Password != null) + hashCode = hashCode * 59 + this.Password.GetHashCode(); + if (this.Company != null) + hashCode = hashCode * 59 + this.Company.GetHashCode(); + if (this.Tenant != null) + hashCode = hashCode * 59 + this.Tenant.GetHashCode(); + if (this.Branch != null) + hashCode = hashCode * 59 + this.Branch.GetHashCode(); + if (this.Locale != null) + hashCode = hashCode * 59 + this.Locale.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Acumatica.RESTClient/Model/Endpoint.cs b/Acumatica.RESTClient/Model/Endpoint.cs new file mode 100644 index 00000000..d19f406f --- /dev/null +++ b/Acumatica.RESTClient/Model/Endpoint.cs @@ -0,0 +1,156 @@ +/* + * Some version + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Acumatica.RESTClient.Client.OpenAPIDateConverter; + +namespace Acumatica.Auth.Model +{ + /// + /// Endpoint + /// + [DataContract] + public partial class Endpoint : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + /// version. + /// href. + public Endpoint(string name = default(string), string version = default(string), string href = default(string)) + { + this.Name = name; + this.Version = version; + this.Href = href; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Gets or Sets Version + /// + [DataMember(Name="version", EmitDefaultValue=false)] + public string Version { get; set; } + + /// + /// Gets or Sets Href + /// + [DataMember(Name="href", EmitDefaultValue=false)] + public string Href { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Endpoint {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" Href: ").Append(Href).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Endpoint); + } + + /// + /// Returns true if Endpoint instances are equal + /// + /// Instance of Endpoint to be compared + /// Boolean + public bool Equals(Endpoint input) + { + if (input == null) + return false; + + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ) && + ( + this.Version == input.Version || + (this.Version != null && + this.Version.Equals(input.Version)) + ) && + ( + this.Href == input.Href || + (this.Href != null && + this.Href.Equals(input.Href)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + if (this.Version != null) + hashCode = hashCode * 59 + this.Version.GetHashCode(); + if (this.Href != null) + hashCode = hashCode * 59 + this.Href.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Acumatica.RESTClient/Model/Entity.cs b/Acumatica.RESTClient/Model/EntityBase/Entity.cs similarity index 100% rename from Acumatica.RESTClient/Model/Entity.cs rename to Acumatica.RESTClient/Model/EntityBase/Entity.cs diff --git a/Acumatica.RESTClient/Model/EntityAction.cs b/Acumatica.RESTClient/Model/EntityBase/EntityAction.cs similarity index 100% rename from Acumatica.RESTClient/Model/EntityAction.cs rename to Acumatica.RESTClient/Model/EntityBase/EntityAction.cs diff --git a/Acumatica.RESTClient/Model/EntityActionWithParameters.cs b/Acumatica.RESTClient/Model/EntityBase/EntityActionWithParameters.cs similarity index 100% rename from Acumatica.RESTClient/Model/EntityActionWithParameters.cs rename to Acumatica.RESTClient/Model/EntityBase/EntityActionWithParameters.cs diff --git a/Acumatica.RESTClient/Model/Entity_v3.cs b/Acumatica.RESTClient/Model/EntityBase/Entity_v3.cs similarity index 100% rename from Acumatica.RESTClient/Model/Entity_v3.cs rename to Acumatica.RESTClient/Model/EntityBase/Entity_v3.cs diff --git a/Acumatica.RESTClient/Model/Entity_v4.cs b/Acumatica.RESTClient/Model/EntityBase/Entity_v4.cs similarity index 100% rename from Acumatica.RESTClient/Model/Entity_v4.cs rename to Acumatica.RESTClient/Model/EntityBase/Entity_v4.cs diff --git a/Acumatica.RESTClient/Model/Version.cs b/Acumatica.RESTClient/Model/Version.cs new file mode 100644 index 00000000..8f6df197 --- /dev/null +++ b/Acumatica.RESTClient/Model/Version.cs @@ -0,0 +1,156 @@ +/* + * Some version + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Acumatica.RESTClient.Client.OpenAPIDateConverter; + +namespace Acumatica.Auth.Model +{ + /// + /// Version + /// + [DataContract] + public partial class Version : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// acumaticaBuildVersion. + /// oemBuildVersion. + /// databaseVersion. + public Version(string acumaticaBuildVersion = default(string), string oemBuildVersion = default(string), string databaseVersion = default(string)) + { + this.AcumaticaBuildVersion = acumaticaBuildVersion; + this.OemBuildVersion = oemBuildVersion; + this.DatabaseVersion = databaseVersion; + } + + /// + /// Gets or Sets AcumaticaBuildVersion + /// + [DataMember(Name="acumaticaBuildVersion", EmitDefaultValue=false)] + public string AcumaticaBuildVersion { get; set; } + + /// + /// Gets or Sets OemBuildVersion + /// + [DataMember(Name="oemBuildVersion", EmitDefaultValue=false)] + public string OemBuildVersion { get; set; } + + /// + /// Gets or Sets DatabaseVersion + /// + [DataMember(Name="databaseVersion", EmitDefaultValue=false)] + public string DatabaseVersion { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Version {\n"); + sb.Append(" AcumaticaBuildVersion: ").Append(AcumaticaBuildVersion).Append("\n"); + sb.Append(" OemBuildVersion: ").Append(OemBuildVersion).Append("\n"); + sb.Append(" DatabaseVersion: ").Append(DatabaseVersion).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Version); + } + + /// + /// Returns true if Version instances are equal + /// + /// Instance of Version to be compared + /// Boolean + public bool Equals(Version input) + { + if (input == null) + return false; + + return + ( + this.AcumaticaBuildVersion == input.AcumaticaBuildVersion || + (this.AcumaticaBuildVersion != null && + this.AcumaticaBuildVersion.Equals(input.AcumaticaBuildVersion)) + ) && + ( + this.OemBuildVersion == input.OemBuildVersion || + (this.OemBuildVersion != null && + this.OemBuildVersion.Equals(input.OemBuildVersion)) + ) && + ( + this.DatabaseVersion == input.DatabaseVersion || + (this.DatabaseVersion != null && + this.DatabaseVersion.Equals(input.DatabaseVersion)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AcumaticaBuildVersion != null) + hashCode = hashCode * 59 + this.AcumaticaBuildVersion.GetHashCode(); + if (this.OemBuildVersion != null) + hashCode = hashCode * 59 + this.OemBuildVersion.GetHashCode(); + if (this.DatabaseVersion != null) + hashCode = hashCode * 59 + this.DatabaseVersion.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Acumatica.RESTClient/Model/VersionAndEndpoints.cs b/Acumatica.RESTClient/Model/VersionAndEndpoints.cs new file mode 100644 index 00000000..f6c3c31a --- /dev/null +++ b/Acumatica.RESTClient/Model/VersionAndEndpoints.cs @@ -0,0 +1,140 @@ +/* + * Some version + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 1 + * + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Acumatica.RESTClient.Client.OpenAPIDateConverter; + +namespace Acumatica.Auth.Model +{ + /// + /// VersionAndEndpoints + /// + [DataContract] + public partial class VersionAndEndpoints : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// version. + /// endpoints. + public VersionAndEndpoints(Version version = default(Version), List endpoints = default(List)) + { + this.Version = version; + this.Endpoints = endpoints; + } + + /// + /// Gets or Sets Version + /// + [DataMember(Name="version", EmitDefaultValue=false)] + public Version Version { get; set; } + + /// + /// Gets or Sets Endpoints + /// + [DataMember(Name="endpoints", EmitDefaultValue=false)] + public List Endpoints { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class VersionAndEndpoints {\n"); + sb.Append(" Version: ").Append(Version).Append("\n"); + sb.Append(" Endpoints: ").Append(Endpoints).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as VersionAndEndpoints); + } + + /// + /// Returns true if VersionAndEndpoints instances are equal + /// + /// Instance of VersionAndEndpoints to be compared + /// Boolean + public bool Equals(VersionAndEndpoints input) + { + if (input == null) + return false; + + return + ( + this.Version == input.Version || + (this.Version != null && + this.Version.Equals(input.Version)) + ) && + ( + this.Endpoints == input.Endpoints || + this.Endpoints != null && + this.Endpoints.SequenceEqual(input.Endpoints) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Version != null) + hashCode = hashCode * 59 + this.Version.GetHashCode(); + if (this.Endpoints != null) + hashCode = hashCode * 59 + this.Endpoints.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Acumatica.RESTClient/Properties/AssemblyInfo.cs b/Acumatica.RESTClient/Properties/AssemblyInfo.cs index d1abdf79..5d0ff8ba 100644 --- a/Acumatica.RESTClient/Properties/AssemblyInfo.cs +++ b/Acumatica.RESTClient/Properties/AssemblyInfo.cs @@ -4,12 +4,12 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("OpenAPI Library")] -[assembly: AssemblyDescription("A library generated from a OpenAPI doc")] +[assembly: AssemblyTitle("Acumatica REST Client")] +[assembly: AssemblyDescription("A simple client allowing to use Acuamtica REST API from C#")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("OpenAPI")] -[assembly: AssemblyProduct("OpenAPILibrary")] -[assembly: AssemblyCopyright("No Copyright")] +[assembly: AssemblyCompany("Acumatica")] +[assembly: AssemblyProduct("AcumaticaRESTClient")] +[assembly: AssemblyCopyright("© 2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -30,3 +30,4 @@ // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0")] +[assembly: Guid("34BCEA8E-F207-46EF-A498-0E07E3BB5D3E")]