C# client for the ComboCurve REST API
View the Project on GitHub insidepetroleum/combocurve-client-csharp
All URIs are relative to https://api.combocurve.com
Method | HTTP request | Description |
---|---|---|
DeleteProjectScenarios | DELETE /v1/projects/{projectId}/scenarios | |
DeleteScenarios | DELETE /v1/projects/{projectId}/scenarios/head | |
GetScenarioById | GET /v1/projects/{projectId}/scenarios/{id} | Returns the scenario document that matches the given id scoped to projectId project. |
GetScenarios | GET /v1/projects/{projectId}/scenarios | Returns a list of scenario documents scoped to projectId project. |
HeadScenarios | HEAD /v1/projects/{projectId}/scenarios | Returns metadata about the existing scenario documents scoped to projectId project. |
PostProjectScenarios | POST /v1/projects/{projectId}/scenarios | Inserts a list of scenario documents. |
PutProjectScenarios | PUT /v1/projects/{projectId}/scenarios | Update a list of scenario documents. |
void DeleteProjectScenarios (string projectId, List
name = null, List id = null)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class DeleteProjectScenariosExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string | Project ID
var name = new List<string>(); // List<string> | The name of the scenario to delete. If this is not provided, the id parameter must be provided. (optional)
var id = new List<string>(); // List<string> | The id of the scenario to delete. If this is not provided, the name parameter must be provided. (optional)
try
{
apiInstance.DeleteProjectScenarios(projectId, name, id);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenariosApi.DeleteProjectScenarios: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | string | Project ID | |
name | List<string> | The name of the scenario to delete. If this is not provided, the id parameter must be provided. | [optional] [Max number of items is 20] |
id | List<string> | The id of the scenario to delete. If this is not provided, the name parameter must be provided. | [optional] |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 204 | NoContent Response | * x-delete-count - | | 400 | BadRequest Response | - | | 404 | NotFound Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteScenarios (string projectId, List
name, List id)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class DeleteScenariosExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string | Project ID
var name = new List<string>(); // List<string> | The name of the scenario to delete. If this is not provided, the id parameter must be provided.
var id = new List<string>(); // List<string> | The id of the scenario to delete. If this is not provided, the name parameter must be provided.
try
{
apiInstance.DeleteScenarios(projectId, name, id);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenariosApi.DeleteScenarios: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | string | Project ID | |
name | List<string> | The name of the scenario to delete. If this is not provided, the id parameter must be provided. | [Max number of items is 20] |
id | List<string> | The id of the scenario to delete. If this is not provided, the name parameter must be provided. |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 204 | NoContent Response | * x-delete-count - | | 400 | BadRequest Response | - | | 404 | NotFound Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Scenario GetScenarioById (string projectId, string id)
Returns the scenario document that matches the given id scoped to projectId project.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class GetScenarioByIdExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var id = "id_example"; // string |
try
{
// Returns the scenario document that matches the given id scoped to projectId project.
Scenario result = apiInstance.GetScenarioById(projectId, id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenariosApi.GetScenarioById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | string | ||
id | string |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | - | | 400 | Bad Request. There is something wrong with the request data. | - | | 404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ICollection<Scenario> GetScenarios (string projectId, int? skip = null, int? take = null, string sort = null, string cursor = null, DateTimeOffset? createdAt = null, string name = null, DateTimeOffset? updatedAt = null)
Returns a list of scenario documents scoped to projectId project.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class GetScenariosExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var skip = 56; // int? | number of items to skip (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 25) (between 1 and 200)
var sort = "sort_example"; // string | field to sort by, including + or - at the beginning for ascending or descending order, respectively (optional)
var cursor = "cursor_example"; // string | used in pagination to get the next page (optional)
var createdAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by createdAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example createdAt[gt]=2018-01-01T00:00:00Z (optional)
var name = "name_example"; // string | filter by name (optional)
var updatedAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by updatedAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example updatedAt[gt]=2018-01-01T00:00:00Z (optional)
try
{
// Returns a list of scenario documents scoped to projectId project.
ICollection<Scenario> result = apiInstance.GetScenarios(projectId, skip, take, sort, cursor, createdAt, name, updatedAt);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenariosApi.GetScenarios: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | string | ||
skip | int? | number of items to skip | [optional] [default to 0] |
take | int? | max records to return | [optional] [default to 25] [between 1 and 200] |
sort | string | field to sort by, including + or - at the beginning for ascending or descending order, respectively | [optional] |
cursor | string | used in pagination to get the next page | [optional] |
createdAt | DateTimeOffset? | filter by createdAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example createdAt[gt]=2018-01-01T00:00:00Z | [optional] |
name | string | filter by name | [optional] |
updatedAt | DateTimeOffset? | filter by updatedAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example updatedAt[gt]=2018-01-01T00:00:00Z | [optional] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | * Link - Indicates a typed relationship with another resource, where the relation type is defined by RFC 5988. We include the relationships next, prev, first and last, which can be used to move between pages of the list of results. | | 400 | Bad Request. There is something wrong with the request data. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void HeadScenarios (string projectId, int? skip = null, int? take = null, DateTimeOffset? createdAt = null, string name = null, DateTimeOffset? updatedAt = null)
Returns metadata about the existing scenario documents scoped to projectId project.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class HeadScenariosExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var skip = 56; // int? | number of items to skip (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 25) (between 1 and 200)
var createdAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by createdAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example createdAt[gt]=2018-01-01T00:00:00Z (optional)
var name = "name_example"; // string | filter by name (optional)
var updatedAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by updatedAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example updatedAt[gt]=2018-01-01T00:00:00Z (optional)
try
{
// Returns metadata about the existing scenario documents scoped to projectId project.
apiInstance.HeadScenarios(projectId, skip, take, createdAt, name, updatedAt);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenariosApi.HeadScenarios: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | string | ||
skip | int? | number of items to skip | [optional] [default to 0] |
take | int? | max records to return | [optional] [default to 25] [between 1 and 200] |
createdAt | DateTimeOffset? | filter by createdAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example createdAt[gt]=2018-01-01T00:00:00Z | [optional] |
name | string | filter by name | [optional] |
updatedAt | DateTimeOffset? | filter by updatedAt - Operator values are [lt] = less than, [le] = less than or equal, [gt] = greater than, [ge] = greater than or equal, no operator = equal. Example updatedAt[gt]=2018-01-01T00:00:00Z | [optional] |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers |
|————-|————-|——————|
| 200 | OK | * X-Query-Count - The number of records in this resource. When filters are provided only matching records are counted.
* Link - Indicates a typed relationship with another resource, where the relation type is defined by RFC 5988. We include the relationships next, prev, first and last, which can be used to move between pages of the list of results. |
| 400 | Bad Request. There is something wrong with the request data. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ScenarioMultiStatusResponse PostProjectScenarios (string projectId, List
scenarios = null)
Inserts a list of scenario documents.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class PostProjectScenariosExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarios = new List<ScenarioPayload>(); // List<ScenarioPayload> | Scenario document(s) to insert (optional)
try
{
// Inserts a list of scenario documents.
ScenarioMultiStatusResponse result = apiInstance.PostProjectScenarios(projectId, scenarios);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenariosApi.PostProjectScenarios: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | string | ||
scenarios | List<ScenarioPayload> | Scenario document(s) to insert | [optional] [Max number of items is 200] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 207 | Multi-Status | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ScenarioMultiStatusResponse PutProjectScenarios (string projectId, List
scenarios = null)
Update a list of scenario documents.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ComboCurve.Api.Api;
using ComboCurve.Api.Auth;
using ComboCurve.Api.Client;
using ComboCurve.Api.Model;
namespace Example
{
public class PutProjectScenariosExample
{
public static void Main()
{
// Use this to create your service account manually
var serviceAccount = new ServiceAccount
{
ClientEmail = "YOUR_CLIENT_EMAIL",
ClientId = "YOUR_CLIENT_ID",
PrivateKey = "YOUR_PRIVATE_KEY"
};
// Or use this to load it from a JSON file
// var serviceAccount = ServiceAccount.FromFile("PATH_TO_JSON_FILE");
// Set your API key
var apiKey = "YOUR_API_KEY";
var apiInstance = new ComboCurveV1Api(serviceAccount, apiKey);
// Or use the specific API class (Recommended)
// var apiInstance = new ScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarios = new List<ScenarioPayload>(); // List<ScenarioPayload> | Scenario document(s) to insert (optional)
try
{
// Update a list of scenario documents.
ScenarioMultiStatusResponse result = apiInstance.PutProjectScenarios(projectId, scenarios);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenariosApi.PutProjectScenarios: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
projectId | string | ||
scenarios | List<ScenarioPayload> | Scenario document(s) to insert | [optional] [Max number of items is 200] |
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 207 | Multi-Status | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]