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 |
|---|---|---|
| DeleteInventoryScenarioModelAssignments | DELETE /v1/projects/{projectId}/inventory/scenarios/{scenarioId}/assignments/models | Clears forecast assignments. Each record clears one qualifier for `wellIds` or `allWells`; with `modelId`, only slots holding that forecast are cleared. P-series assignments cannot be cleared, since economics needs a series for every well: assign another with PUT instead. All-or-nothing: if any record or well is invalid, nothing is cleared. Accepts an array of records (max 500), targeting at most 325,000 scenario-well-assignments in total, an `allWells` record counting as every row it resolves to. Without `qualifierName`, a record uses the column's active qualifier. A facility named in `wellIds` is invalid (`NonWellEntityNotAssignable`), so nothing is cleared. An `allWells` record clears every row in the scenario, facilities included. Applies to an inventory scenario, which can hold proposed wells. A regular scenario is not found. |
| GetInventoryScenarioModelAssignments | GET /v1/projects/{projectId}/inventory/scenarios/{scenarioId}/assignments/models | Returns forecast and p-series assignments for the scenario, grouped by well. Reads each well's base row unless `incrementalIndex` is given. Econ model assignments are served by `…/assignments/econ-models`. A well with no p-series assigned is evaluated at P50 by economics. Applies to an inventory scenario, which can hold proposed wells. A regular scenario is not found. |
| PutInventoryScenarioModelAssignments | PUT /v1/projects/{projectId}/inventory/scenarios/{scenarioId}/assignments/models | Assigns forecasts and p-series to wells in the scenario. Each record assigns one forecast (`modelId`) or one series (`series`), in one column and qualifier, to `wellIds` (up to 25,000 across the request) or to every well in the scenario (`allWells`). Records target each well's base row unless `incrementalIndex` is given. A forecast must belong to the project, and is only assigned to wells it contains, unless `addWellsToForecast` is set. Accepts an array of records (max 500), targeting at most 325,000 scenario-well-assignments in total, an `allWells` record counting as every row it resolves to. Returns one result per record; wells a record could not write are listed in its `errors` and the rest are written. The `schedule` and `network` columns will be supported here later. Without `qualifierName`, a record uses the column's active qualifier. With `addWellsToForecast=true` this request also modifies forecasts: wells missing from a record's forecast are added to it before the assignments are written, as `POST …/forecasts/{id}/wells` does. Adding a well creates its forecast data, and unassigning the forecast later does not remove the well from it. A facility named in `wellIds` is not written; the record lists it in `errors` as `NonWellEntityNotAssignable`. A proposed well is written for `pSeries`. A `forecast` record for a proposed well fails with `WellNotInForecast`, because proposed wells are in no forecast and `addWellsToForecast` cannot add them. An `allWells` record writes every row in the scenario, facilities included. Applies to an inventory scenario, which can hold proposed wells. A regular scenario is not found. |
void DeleteInventoryScenarioModelAssignments (string projectId, string scenarioId, List
modelAssignments = null)
Clears forecast assignments. Each record clears one qualifier for wellIds or allWells; with modelId, only slots holding that forecast are cleared. P-series assignments cannot be cleared, since economics needs a series for every well: assign another with PUT instead. All-or-nothing: if any record or well is invalid, nothing is cleared. Accepts an array of records (max 500), targeting at most 325,000 scenario-well-assignments in total, an allWells record counting as every row it resolves to. Without qualifierName, a record uses the column’s active qualifier. A facility named in wellIds is invalid (NonWellEntityNotAssignable), so nothing is cleared. An allWells record clears every row in the scenario, facilities included. Applies to an inventory scenario, which can hold proposed wells. 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 DeleteInventoryScenarioModelAssignmentsExample
{
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 InventoryScenarioModelAssignmentsApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarioId = "scenarioId_example"; // string |
var modelAssignments = new List<ModelAssignmentDelete>(); // List<ModelAssignmentDelete> | Model assignment record(s) to clear. (optional)
try
{
// Clears forecast assignments. Each record clears one qualifier for `wellIds` or `allWells`; with `modelId`, only slots holding that forecast are cleared. P-series assignments cannot be cleared, since economics needs a series for every well: assign another with PUT instead. All-or-nothing: if any record or well is invalid, nothing is cleared. Accepts an array of records (max 500), targeting at most 325,000 scenario-well-assignments in total, an `allWells` record counting as every row it resolves to. Without `qualifierName`, a record uses the column's active qualifier. A facility named in `wellIds` is invalid (`NonWellEntityNotAssignable`), so nothing is cleared. An `allWells` record clears every row in the scenario, facilities included. Applies to an inventory scenario, which can hold proposed wells. A regular scenario is not found.
apiInstance.DeleteInventoryScenarioModelAssignments(projectId, scenarioId, modelAssignments);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InventoryScenarioModelAssignmentsApi.DeleteInventoryScenarioModelAssignments: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| scenarioId | string | ||
| modelAssignments | List<ModelAssignmentDelete> | Model assignment record(s) to clear. | [optional] [Max number of items is 500] |
void (empty response body)
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 204 | No Content | * 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]
ICollection<ModelWellAssignment> GetInventoryScenarioModelAssignments (string projectId, string scenarioId, List
model = null, string qualifierName = null, List wellId = null, int? incrementalIndex = null, int? take = null, int? skip = null, string cursor = null)
Returns forecast and p-series assignments for the scenario, grouped by well. Reads each well’s base row unless incrementalIndex is given. Econ model assignments are served by .../assignments/econ-models. A well with no p-series assigned is evaluated at P50 by economics. Applies to an inventory scenario, which can hold proposed wells. 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 GetInventoryScenarioModelAssignmentsExample
{
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 InventoryScenarioModelAssignmentsApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarioId = "scenarioId_example"; // string |
var model = "model_example"; // List<string> | Filter by column(s). (optional)
var qualifierName = "qualifierName_example"; // string | Filter by qualifier name. (optional)
var wellId = new List<string>(); // List<string> | Filter by well ID(s) (ObjectId). Up to 100 values. (optional)
var incrementalIndex = 56; // int? | Incremental to read; omitted or 0 reads each well's base row. Matching wells are echoed with `incrementalIndex`. (optional)
var take = 56; // int? | Maximum number of records to return (1–500). (optional) (default to 25) (between 1 and 500)
var skip = 56; // int? | Number of records to skip. Omit it to page by cursor. Cannot be combined with `cursor`; sending both returns 400. (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. (optional)
try
{
// Returns forecast and p-series assignments for the scenario, grouped by well. Reads each well's base row unless `incrementalIndex` is given. Econ model assignments are served by `.../assignments/econ-models`. A well with no p-series assigned is evaluated at P50 by economics. Applies to an inventory scenario, which can hold proposed wells. A regular scenario is not found.
ICollection<ModelWellAssignment> result = apiInstance.GetInventoryScenarioModelAssignments(projectId, scenarioId, model, qualifierName, wellId, incrementalIndex, take, skip, cursor);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InventoryScenarioModelAssignmentsApi.GetInventoryScenarioModelAssignments: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| scenarioId | string | ||
| model | List<string> | Filter by column(s). | [optional] |
| qualifierName | string | Filter by qualifier name. | [optional] |
| wellId | List<string> | Filter by well ID(s) (ObjectId). Up to 100 values. | [optional] |
| incrementalIndex | int? | Incremental to read; omitted or 0 reads each well's base row. Matching wells are echoed with `incrementalIndex`. | [optional] |
| take | int? | Maximum number of records to return (1–500). | [optional] [default to 25] [between 1 and 500] |
| skip | int? | Number of records to skip. Omit it to page by cursor. Cannot be combined with `cursor`; sending both returns 400. | [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. | [optional] |
ICollection<ModelWellAssignment>
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, 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]
ModelAssignmentMultiStatusResponse PutInventoryScenarioModelAssignments (string projectId, string scenarioId, bool? addWellsToForecast = null, List
modelAssignments = null)
Assigns forecasts and p-series to wells in the scenario. Each record assigns one forecast (modelId) or one series (series), in one column and qualifier, to wellIds (up to 25,000 across the request) or to every well in the scenario (allWells). Records target each well’s base row unless incrementalIndex is given. A forecast must belong to the project, and is only assigned to wells it contains, unless addWellsToForecast is set. Accepts an array of records (max 500), targeting at most 325,000 scenario-well-assignments in total, an allWells record counting as every row it resolves to. Returns one result per record; wells a record could not write are listed in its errors and the rest are written. The schedule and network columns will be supported here later. Without qualifierName, a record uses the column’s active qualifier. With addWellsToForecast=true this request also modifies forecasts: wells missing from a record’s forecast are added to it before the assignments are written, as POST .../forecasts/{id}/wells does. Adding a well creates its forecast data, and unassigning the forecast later does not remove the well from it. A facility named in wellIds is not written; the record lists it in errors as NonWellEntityNotAssignable. A proposed well is written for pSeries. A forecast record for a proposed well fails with WellNotInForecast, because proposed wells are in no forecast and addWellsToForecast cannot add them. An allWells record writes every row in the scenario, facilities included. Applies to an inventory scenario, which can hold proposed wells. 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 PutInventoryScenarioModelAssignmentsExample
{
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 InventoryScenarioModelAssignmentsApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var scenarioId = "scenarioId_example"; // string |
var addWellsToForecast = true; // bool? | **Modifies the forecast.** Adds the wells a `forecast` record targets that its forecast does not contain, then assigns them, instead of reporting them as `WellNotInForecast`. Each forecast is added to once, however many records reference it, and only wells in the project are added (`WellNotInProject` otherwise). A forecast that would exceed 25,000 wells is left unchanged and its missing wells fail with `ForecastWellLimitExceeded`. Results report `wellsAddedToForecast`. The forecast is changed before the assignments are written; if a record then fails, its result is `Failed` with `ForecastWellsAddedAssignmentFailed` (or `ForecastWellsNotAdded` when its own forecast could not be changed). Retrying a completed request adds no wells twice, but don't send overlapping requests for the same forecast concurrently: both could add the same wells. Ignored for `pSeries` records. (optional) (default to false)
var modelAssignments = new List<ModelAssignmentInput>(); // List<ModelAssignmentInput> | Model assignment record(s). (optional)
try
{
// Assigns forecasts and p-series to wells in the scenario. Each record assigns one forecast (`modelId`) or one series (`series`), in one column and qualifier, to `wellIds` (up to 25,000 across the request) or to every well in the scenario (`allWells`). Records target each well's base row unless `incrementalIndex` is given. A forecast must belong to the project, and is only assigned to wells it contains, unless `addWellsToForecast` is set. Accepts an array of records (max 500), targeting at most 325,000 scenario-well-assignments in total, an `allWells` record counting as every row it resolves to. Returns one result per record; wells a record could not write are listed in its `errors` and the rest are written. The `schedule` and `network` columns will be supported here later. Without `qualifierName`, a record uses the column's active qualifier. **With `addWellsToForecast=true` this request also modifies forecasts:** wells missing from a record's forecast are added to it before the assignments are written, as `POST .../forecasts/{id}/wells` does. Adding a well creates its forecast data, and unassigning the forecast later does not remove the well from it. A facility named in `wellIds` is not written; the record lists it in `errors` as `NonWellEntityNotAssignable`. A proposed well is written for `pSeries`. A `forecast` record for a proposed well fails with `WellNotInForecast`, because proposed wells are in no forecast and `addWellsToForecast` cannot add them. An `allWells` record writes every row in the scenario, facilities included. Applies to an inventory scenario, which can hold proposed wells. A regular scenario is not found.
ModelAssignmentMultiStatusResponse result = apiInstance.PutInventoryScenarioModelAssignments(projectId, scenarioId, addWellsToForecast, modelAssignments);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling InventoryScenarioModelAssignmentsApi.PutInventoryScenarioModelAssignments: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| scenarioId | string | ||
| addWellsToForecast | bool? | Modifies the forecast. Adds the wells a `forecast` record targets that its forecast does not contain, then assigns them, instead of reporting them as `WellNotInForecast`. Each forecast is added to once, however many records reference it, and only wells in the project are added (`WellNotInProject` otherwise). A forecast that would exceed 25,000 wells is left unchanged and its missing wells fail with `ForecastWellLimitExceeded`. Results report `wellsAddedToForecast`. The forecast is changed before the assignments are written; if a record then fails, its result is `Failed` with `ForecastWellsAddedAssignmentFailed` (or `ForecastWellsNotAdded` when its own forecast could not be changed). Retrying a completed request adds no wells twice, but don't send overlapping requests for the same forecast concurrently: both could add the same wells. Ignored for `pSeries` records. | [optional] [default to false] |
| modelAssignments | List<ModelAssignmentInput> | Model assignment record(s). | [optional] [Max number of items is 500] |
ModelAssignmentMultiStatusResponse
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, 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]