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 |
|---|---|---|
| DeleteScenarioModelAssignments | DELETE /v1/projects/{projectId}/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. |
| GetScenarioModelAssignments | GET /v1/projects/{projectId}/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. |
| PutScenarioModelAssignments | PUT /v1/projects/{projectId}/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; facilities take neither column. 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. 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. |
void DeleteScenarioModelAssignments (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.
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 DeleteScenarioModelAssignmentsExample
{
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 ScenarioModelAssignmentsApi(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.
apiInstance.DeleteScenarioModelAssignments(projectId, scenarioId, modelAssignments);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenarioModelAssignmentsApi.DeleteScenarioModelAssignments: " + 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. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ICollection<ModelWellAssignment> GetScenarioModelAssignments (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.
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 GetScenarioModelAssignmentsExample
{
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 ScenarioModelAssignmentsApi(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) (between 1 and 500)
var skip = 56; // int? | Number of records to skip. (optional)
var cursor = "cursor_example"; // string | Cursor for cursor-based pagination (base64-encoded). (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.
ICollection<ModelWellAssignment> result = apiInstance.GetScenarioModelAssignments(projectId, scenarioId, model, qualifierName, wellId, incrementalIndex, take, skip, cursor);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenarioModelAssignmentsApi.GetScenarioModelAssignments: " + 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] [between 1 and 500] |
| skip | int? | Number of records to skip. | [optional] |
| cursor | string | Cursor for cursor-based pagination (base64-encoded). | [optional] |
ICollection<ModelWellAssignment>
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]
ModelAssignmentMultiStatusResponse PutScenarioModelAssignments (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; facilities take neither column. 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. 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.
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 PutScenarioModelAssignmentsExample
{
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 ScenarioModelAssignmentsApi(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; facilities take neither column. 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. **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.
ModelAssignmentMultiStatusResponse result = apiInstance.PutScenarioModelAssignments(projectId, scenarioId, addWellsToForecast, modelAssignments);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ScenarioModelAssignmentsApi.PutScenarioModelAssignments: " + 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. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]