Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Update to use the new application authentication APIs #16

Merged
merged 4 commits into from
Aug 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

329 changes: 308 additions & 21 deletions src/SymphonyOSS.RestApiClient.Generated/OpenApi/AgentApi/Api/ShareApi.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
/*
* Agent API
*
* This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to aome subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://developers.symphony.com/documentation/message_format_reference
*
* OpenAPI spec version: 1.38.0
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand All @@ -27,14 +49,14 @@ namespace SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Api
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface ISystemApi
public interface ISystemApi : IApiAccessor
{
#region Synchronous Operations
/// <summary>
/// Checks the health of the Agent.
/// </summary>
/// <remarks>
/// Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </remarks>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>V1HealthCheckResponse</returns>
Expand All @@ -44,7 +66,7 @@ public interface ISystemApi
/// Checks the health of the Agent.
/// </summary>
/// <remarks>
/// Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </remarks>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of V1HealthCheckResponse</returns>
Expand All @@ -55,7 +77,7 @@ public interface ISystemApi
/// Checks the health of the Agent.
/// </summary>
/// <remarks>
/// Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </remarks>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of V1HealthCheckResponse</returns>
Expand All @@ -65,7 +87,7 @@ public interface ISystemApi
/// Checks the health of the Agent.
/// </summary>
/// <remarks>
/// Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </remarks>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of ApiResponse (V1HealthCheckResponse)</returns>
Expand All @@ -76,8 +98,10 @@ public interface ISystemApi
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public class SystemApi : ISystemApi
public partial class SystemApi : ISystemApi
{
private SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ExceptionFactory _exceptionFactory = (name, response) => null;

/// <summary>
/// Initializes a new instance of the <see cref="SystemApi"/> class.
/// </summary>
Expand All @@ -86,6 +110,8 @@ public SystemApi(String basePath)
{
this.Configuration = new Configuration(new ApiClient(basePath));

ExceptionFactory = SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.Configuration.DefaultExceptionFactory;

// ensure API client has configuration ready
if (Configuration.ApiClient.Configuration == null)
{
Expand All @@ -106,6 +132,8 @@ public SystemApi(Configuration configuration = null)
else
this.Configuration = configuration;

ExceptionFactory = SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.Configuration.DefaultExceptionFactory;

// ensure API client has configuration ready
if (Configuration.ApiClient.Configuration == null)
{
Expand All @@ -126,7 +154,7 @@ public String GetBasePath()
/// Sets the base path of the API client.
/// </summary>
/// <value>The base path</value>
[Obsolete("SetBasePath is deprecated, please do 'Configuraiton.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
[Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
public void SetBasePath(String basePath)
{
// do nothing
Expand All @@ -138,6 +166,22 @@ public void SetBasePath(String basePath)
/// <value>An instance of the Configuration</value>
public Configuration Configuration {get; set;}

/// <summary>
/// Provides a factory method hook for the creation of exceptions.
/// </summary>
public SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ExceptionFactory ExceptionFactory
{
get
{
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
{
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
}
return _exceptionFactory;
}
set { _exceptionFactory = value; }
}

/// <summary>
/// Gets the default header.
/// </summary>
Expand All @@ -161,7 +205,7 @@ public void AddDefaultHeader(string key, string value)
}

/// <summary>
/// Checks the health of the Agent. Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Checks the health of the Agent. Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </summary>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>V1HealthCheckResponse</returns>
Expand All @@ -172,7 +216,7 @@ public V1HealthCheckResponse V1HealthCheckGet ()
}

/// <summary>
/// Checks the health of the Agent. Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Checks the health of the Agent. Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </summary>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of V1HealthCheckResponse</returns>
Expand Down Expand Up @@ -212,10 +256,11 @@ public ApiResponse< V1HealthCheckResponse > V1HealthCheckGetWithHttpInfo ()

int localVarStatusCode = (int) localVarResponse.StatusCode;

if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling V1HealthCheckGet: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling V1HealthCheckGet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("V1HealthCheckGet", localVarResponse);
if (exception != null) throw exception;
}

return new ApiResponse<V1HealthCheckResponse>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
Expand All @@ -224,7 +269,7 @@ public ApiResponse< V1HealthCheckResponse > V1HealthCheckGetWithHttpInfo ()
}

/// <summary>
/// Checks the health of the Agent. Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Checks the health of the Agent. Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </summary>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of V1HealthCheckResponse</returns>
Expand All @@ -236,7 +281,7 @@ public async System.Threading.Tasks.Task<V1HealthCheckResponse> V1HealthCheckGet
}

/// <summary>
/// Checks the health of the Agent. Used to validate the configuration of the agent.\nMakes a request to the HealthCheck on the Symphony cloud.\nMakes a request to the HealthCheck on the Key Manager service.\n
/// Checks the health of the Agent. Used to validate the configuration of the agent. Makes a request to the HealthCheck on the Symphony cloud. Makes a request to the HealthCheck on the Key Manager service.
/// </summary>
/// <exception cref="SymphonyOSS.RestApiClient.Generated.OpenApi.AgentApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Task of ApiResponse (V1HealthCheckResponse)</returns>
Expand Down Expand Up @@ -276,10 +321,11 @@ public async System.Threading.Tasks.Task<ApiResponse<V1HealthCheckResponse>> V1H

int localVarStatusCode = (int) localVarResponse.StatusCode;

if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling V1HealthCheckGet: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling V1HealthCheckGet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
if (ExceptionFactory != null)
{
Exception exception = ExceptionFactory("V1HealthCheckGet", localVarResponse);
if (exception != null) throw exception;
}

return new ApiResponse<V1HealthCheckResponse>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
Expand Down
Loading