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 |
|---|---|---|
| DeleteProjectInventoryScenarioById | DELETE /v1/projects/{projectId}/inventory/scenarios/{id} | Deletes the inventory scenario that matches the given id in the project, with its assignments, as the app does. A regular scenario, or a scenario of another project, is not found. |
| GetProjectInventoryScenarioById | GET /v1/projects/{projectId}/inventory/scenarios/{id} | Returns the inventory scenario that matches the given id in the project. A regular scenario, or a scenario of another project, is not found. |
| GetProjectInventoryScenarios | GET /v1/projects/{projectId}/inventory/scenarios | Returns the inventory scenarios of the project, oldest first by default. Each scenario lists the plans whose wells it holds. A page holds at most 25 scenarios. Regular scenarios are not included. |
| HeadProjectInventoryScenarios | HEAD /v1/projects/{projectId}/inventory/scenarios | Returns the number of inventory scenarios of the project in `X-Query-Count`, without a body. |
| PostProjectInventoryScenarioPlans | POST /v1/projects/{projectId}/inventory/scenarios/{id}/plans | Adds the wells of inventory plans to an inventory scenario, and gives each new well an assignment, as the app does. Send 1 to 500 plan ids. The request is all or nothing. A plan that is already in the scenario, or a plan with no wells, is refused and nothing is added. A regular scenario is not found. |
| PostProjectInventoryScenarios | POST /v1/projects/{projectId}/inventory/scenarios | Creates inventory scenarios from inventory plans. Each scenario holds the wells of its plans, proposed wells included, and gives each well an assignment, as the app does when it creates a scenario from plans. A request holds at most 10 scenarios. Scenario names are unique in the project, regular scenarios included, and across the records of the request. Names are compared exactly. A record that fails validation is reported and the other records are written. A plan that is not in the project, or that has no wells, fails its record. |
void DeleteProjectInventoryScenarioById (string projectId, string id)
Deletes the inventory scenario that matches the given id in the project, with its assignments, as the app does. A regular scenario, or a scenario of another project, is not found.
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 DeleteProjectInventoryScenarioByIdExample
{
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 ProjectInventoryScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var id = "id_example"; // string |
try
{
// Deletes the inventory scenario that matches the given id in the project, with its assignments, as the app does. A regular scenario, or a scenario of another project, is not found.
apiInstance.DeleteProjectInventoryScenarioById(projectId, id);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProjectInventoryScenariosApi.DeleteProjectInventoryScenarioById: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| id | string |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 204 | OK | * X-Delete-Count - The number of records that were deleted. | | 400 | Bad Request. There is something wrong with the request data. | - | | 404 | Not Found. Inventory Management is not enabled, the project does not exist, or the inventory scenario does not exist. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InventoryScenario GetProjectInventoryScenarioById (string projectId, string id)
Returns the inventory scenario that matches the given id in the project. A regular scenario, or a scenario of another project, is not found.
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 GetProjectInventoryScenarioByIdExample
{
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 ProjectInventoryScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var id = "id_example"; // string |
try
{
// Returns the inventory scenario that matches the given id in the project. A regular scenario, or a scenario of another project, is not found.
InventoryScenario result = apiInstance.GetProjectInventoryScenarioById(projectId, id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProjectInventoryScenariosApi.GetProjectInventoryScenarioById: " + 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. Inventory Management is not enabled, the project does not exist, or the inventory scenario does not exist. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ICollection<InventoryScenario> GetProjectInventoryScenarios (string projectId, int? skip = null, int? take = null, string sort = null, string cursor = null, string name = null, DateTimeOffset? createdAt = null, DateTimeOffset? updatedAt = null)
Returns the inventory scenarios of the project, oldest first by default. Each scenario lists the plans whose wells it holds. A page holds at most 25 scenarios. Regular scenarios are not included.
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 GetProjectInventoryScenariosExample
{
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 ProjectInventoryScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var skip = 56; // int? | number of items to skip. Cannot be combined with `cursor`; sending both returns 400. (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 25) (between 1 and 25)
var sort = "sort_example"; // string | Single field to sort by, with an optional `-` prefix for descending order (ascending is the default). Multiple fields are not supported, and a field the endpoint does not allow returns 400. A literal `+` prefix in a query string is read as a space and returns 400, so send ascending as `%2B` or omit the prefix. (optional)
var cursor = "cursor_example"; // string | Opaque cursor that returns the page after the one that produced it. Copy it from the `next` link of the previous response instead of building it. Cannot be combined with `skip`; sending both returns 400. The cursor only works when results are ordered by the endpoint's cursor field, which is the default order (`id`, or `well` on forecast volumes). With any other `sort` the cursor is ignored and the first page is returned again, so page with `skip` instead. Daily and monthly production endpoints return 400 when `sort` and `cursor` are both sent. (optional)
var name = "name_example"; // string | filter by name (optional)
var createdAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by createdAt (optional)
var updatedAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by updatedAt (optional)
try
{
// Returns the inventory scenarios of the project, oldest first by default. Each scenario lists the plans whose wells it holds. A page holds at most 25 scenarios. Regular scenarios are not included.
ICollection<InventoryScenario> result = apiInstance.GetProjectInventoryScenarios(projectId, skip, take, sort, cursor, name, createdAt, updatedAt);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProjectInventoryScenariosApi.GetProjectInventoryScenarios: " + 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. Cannot be combined with `cursor`; sending both returns 400. | [optional] [default to 0] |
| take | int? | max records to return | [optional] [default to 25] [between 1 and 25] |
| sort | string | Single field to sort by, with an optional `-` prefix for descending order (ascending is the default). Multiple fields are not supported, and a field the endpoint does not allow returns 400. A literal `+` prefix in a query string is read as a space and returns 400, so send ascending as `%2B` or omit the prefix. | [optional] |
| cursor | string | Opaque cursor that returns the page after the one that produced it. Copy it from the `next` link of the previous response instead of building it. Cannot be combined with `skip`; sending both returns 400. The cursor only works when results are ordered by the endpoint's cursor field, which is the default order (`id`, or `well` on forecast volumes). With any other `sort` the cursor is ignored and the first page is returned again, so page with `skip` instead. Daily and monthly production endpoints return 400 when `sort` and `cursor` are both sent. | [optional] |
| name | string | filter by name | [optional] |
| createdAt | DateTimeOffset? | filter by createdAt | [optional] |
| updatedAt | DateTimeOffset? | filter by updatedAt | [optional] |
ICollection<InventoryScenario>
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | * Link - Pagination links in the RFC 8288 `Link` header: `next` (when more results remain), `prev` (not on the first page) and `first`. `last` is never returned. | | 400 | Bad Request. There is something wrong with the request data. | - | | 404 | Not Found. Inventory Management is not enabled, or the project does not exist. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void HeadProjectInventoryScenarios (string projectId, int? skip = null, int? take = null, string name = null, DateTimeOffset? createdAt = null, DateTimeOffset? updatedAt = null)
Returns the number of inventory scenarios of the project in X-Query-Count, without a body.
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 HeadProjectInventoryScenariosExample
{
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 ProjectInventoryScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var skip = 56; // int? | number of items to skip. Cannot be combined with `cursor`; sending both returns 400. (optional) (default to 0)
var take = 56; // int? | max records to return (optional) (default to 25) (between 1 and 25)
var name = "name_example"; // string | filter by name (optional)
var createdAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by createdAt (optional)
var updatedAt = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by updatedAt (optional)
try
{
// Returns the number of inventory scenarios of the project in `X-Query-Count`, without a body.
apiInstance.HeadProjectInventoryScenarios(projectId, skip, take, name, createdAt, updatedAt);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProjectInventoryScenariosApi.HeadProjectInventoryScenarios: " + 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. Cannot be combined with `cursor`; sending both returns 400. | [optional] [default to 0] |
| take | int? | max records to return | [optional] [default to 25] [between 1 and 25] |
| name | string | filter by name | [optional] |
| createdAt | DateTimeOffset? | filter by createdAt | [optional] |
| updatedAt | DateTimeOffset? | filter by updatedAt | [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 - Pagination links in the RFC 8288 `Link` header: `next` (when more results remain), `prev` (not on the first page) and `first`. `last` is never returned. |
| 400 | Bad Request. There is something wrong with the request data. | - |
| 404 | Not Found. Inventory Management is not enabled, or the project does not exist. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InventoryScenarioStatus PostProjectInventoryScenarioPlans (string projectId, string id, InventoryScenarioPlansInput inventoryScenarioPlans)
Adds the wells of inventory plans to an inventory scenario, and gives each new well an assignment, as the app does. Send 1 to 500 plan ids. The request is all or nothing. A plan that is already in the scenario, or a plan with no wells, is refused and nothing is added. A regular scenario is not found.
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 PostProjectInventoryScenarioPlansExample
{
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 ProjectInventoryScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var id = "id_example"; // string |
var inventoryScenarioPlans = new InventoryScenarioPlansInput(); // InventoryScenarioPlansInput |
try
{
// Adds the wells of inventory plans to an inventory scenario, and gives each new well an assignment, as the app does. Send 1 to 500 plan ids. The request is all or nothing. A plan that is already in the scenario, or a plan with no wells, is refused and nothing is added. A regular scenario is not found.
InventoryScenarioStatus result = apiInstance.PostProjectInventoryScenarioPlans(projectId, id, inventoryScenarioPlans);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProjectInventoryScenariosApi.PostProjectInventoryScenarioPlans: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| id | string | ||
| inventoryScenarioPlans | InventoryScenarioPlansInput |
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. Inventory Management is not enabled, the project does not exist, the inventory scenario does not exist, or a plan does not exist. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InventoryScenarioMultiStatusResponse PostProjectInventoryScenarios (string projectId, List
inventoryScenario)
Creates inventory scenarios from inventory plans. Each scenario holds the wells of its plans, proposed wells included, and gives each well an assignment, as the app does when it creates a scenario from plans. A request holds at most 10 scenarios. Scenario names are unique in the project, regular scenarios included, and across the records of the request. Names are compared exactly. A record that fails validation is reported and the other records are written. A plan that is not in the project, or that has no wells, fails its record.
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 PostProjectInventoryScenariosExample
{
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 ProjectInventoryScenariosApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var inventoryScenario = new List<InventoryScenarioInput>(); // List<InventoryScenarioInput> | Inventory scenarios to create. See InventoryScenarioInputList.
try
{
// Creates inventory scenarios from inventory plans. Each scenario holds the wells of its plans, proposed wells included, and gives each well an assignment, as the app does when it creates a scenario from plans. A request holds at most 10 scenarios. Scenario names are unique in the project, regular scenarios included, and across the records of the request. Names are compared exactly. A record that fails validation is reported and the other records are written. A plan that is not in the project, or that has no wells, fails its record.
InventoryScenarioMultiStatusResponse result = apiInstance.PostProjectInventoryScenarios(projectId, inventoryScenario);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProjectInventoryScenariosApi.PostProjectInventoryScenarios: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| inventoryScenario | List<InventoryScenarioInput> | Inventory scenarios to create. See InventoryScenarioInputList. | [Max number of items is 10] |
InventoryScenarioMultiStatusResponse
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 207 | Multi-Status | - | | 400 | Bad Request. There is something wrong with the request data. | - | | 404 | Not Found. Inventory Management is not enabled, or the project does not exist. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]