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 |
|---|---|---|
| GetForecastMonthlyVolumes | GET /v1/projects/{projectId}/forecasts/{forecastId}/monthly-volumes | Returns a list of forecast volumes scoped to projectId project, forecastId forecast, and well. |
| HeadForecastMonthlyVolumes | HEAD /v1/projects/{projectId}/forecasts/{forecastId}/monthly-volumes | Returns metadata about the existing forecast volumes scoped to projectId project, forecastId forecast, and well. |
| PutForecastMonthlyVolumes | PUT /v1/projects/{projectId}/forecasts/{forecastId}/monthly-volumes | Replaces or creates monthly volumetric forecast volumes. Monthly values are converted to daily rates before storage, and repeated requests are idempotent. Each included phase fully replaces its existing stored series; the supplied date range is not merged with previously stored dates. Each top-level well record is atomic during conflict validation: if any submitted phase conflicts, no phase from that well record is written and every conflicting phase is reported. The client may resubmit a well record containing only the non-conflicting phases; omitted phases remain unchanged. Monthly values count toward the limits after calendar-aware daily expansion. Each phase is limited to 20,000 daily-equivalent forecast volume values, and the complete request is limited to 100,000 daily-equivalent forecast volume values. The request body may be one well record or an array of well records. A facility or a proposed well is refused like a well that is not in the forecast. |
ICollection<ForecastVolumes> GetForecastMonthlyVolumes (string projectId, string forecastId, int? skip = null, int? take = null, string sort = null, string cursor = null, string well = null, DateTimeOffset? startDate = null, DateTimeOffset? endDate = null, string phase = null)
Returns a list of forecast volumes scoped to projectId project, forecastId forecast, and well.
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 GetForecastMonthlyVolumesExample
{
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 MonthlyVolumesApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var forecastId = "forecastId_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 200)
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 well = new string[] { "well_example" }; // IEnumerable<string> | filter by well (optional)
var startDate = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by startDate. Returns all records with a startDate greater than or equal to the specified value. (optional)
var endDate = DateTimeOffset.Parse("2013-10-20"); // DateTimeOffset? | filter by endDate. Returns all records with a endDate less than or equal to the specified value. (optional)
var phase = new string[] { "phase_example" }; // IEnumerable<string> | Optional repeatable phase selector. When omitted, responses include only oil, gas, and water. Custom streams are returned only when explicitly requested. Maximum 3 distinct phases. (optional)
try
{
// Returns a list of forecast volumes scoped to projectId project, forecastId forecast, and well.
ICollection<ForecastVolumes> result = apiInstance.GetForecastMonthlyVolumes(projectId, forecastId, skip, take, sort, cursor, well, startDate, endDate, phase);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MonthlyVolumesApi.GetForecastMonthlyVolumes: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| forecastId | 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 200] |
| 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] |
| well | string | filter by well | [optional] |
| startDate | DateTimeOffset? | filter by startDate. Returns all records with a startDate greater than or equal to the specified value. | [optional] |
| endDate | DateTimeOffset? | filter by endDate. Returns all records with a endDate less than or equal to the specified value. | [optional] |
| phase | string | Optional repeatable phase selector. When omitted, responses include only oil, gas, and water. Custom streams are returned only when explicitly requested. Maximum 3 distinct phases. | [optional] |
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 | The requested data was not found, or volumetric forecasts are not enabled for this tenant. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void HeadForecastMonthlyVolumes (string projectId, string forecastId, int? skip = null, int? take = null, string well = null, string phase = null)
Returns metadata about the existing forecast volumes scoped to projectId project, forecastId forecast, and well.
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 HeadForecastMonthlyVolumesExample
{
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 MonthlyVolumesApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var forecastId = "forecastId_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 200)
var well = new string[] { "well_example" }; // IEnumerable<string> | filter by well (optional)
var phase = new string[] { "phase_example" }; // IEnumerable<string> | Optional repeatable phase selector. When omitted, responses include only oil, gas, and water. Custom streams are returned only when explicitly requested. Maximum 3 distinct phases. (optional)
try
{
// Returns metadata about the existing forecast volumes scoped to projectId project, forecastId forecast, and well.
apiInstance.HeadForecastMonthlyVolumes(projectId, forecastId, skip, take, well, phase);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MonthlyVolumesApi.HeadForecastMonthlyVolumes: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| forecastId | 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 200] |
| well | string | filter by well | [optional] |
| phase | string | Optional repeatable phase selector. When omitted, responses include only oil, gas, and water. Custom streams are returned only when explicitly requested. Maximum 3 distinct phases. | [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 | The requested data was not found, or volumetric forecasts are not enabled for this tenant. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ForecastVolumesWriteMultiStatusResponse PutForecastMonthlyVolumes (string projectId, string forecastId, List
forecastVolumes)
Replaces or creates monthly volumetric forecast volumes. Monthly values are converted to daily rates before storage, and repeated requests are idempotent. Each included phase fully replaces its existing stored series; the supplied date range is not merged with previously stored dates. Each top-level well record is atomic during conflict validation: if any submitted phase conflicts, no phase from that well record is written and every conflicting phase is reported. The client may resubmit a well record containing only the non-conflicting phases; omitted phases remain unchanged. Monthly values count toward the limits after calendar-aware daily expansion. Each phase is limited to 20,000 daily-equivalent forecast volume values, and the complete request is limited to 100,000 daily-equivalent forecast volume values. The request body may be one well record or an array of well records. A facility or a proposed well is refused like a well that is not in the forecast.
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 PutForecastMonthlyVolumesExample
{
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 MonthlyVolumesApi(serviceAccount, apiKey);
var projectId = "projectId_example"; // string |
var forecastId = "forecastId_example"; // string |
var forecastVolumes = new List<ForecastVolumesInput>(); // List<ForecastVolumesInput> | A single forecast volume input or an array of forecast volume inputs.
try
{
// Replaces or creates monthly volumetric forecast volumes. Monthly values are converted to daily rates before storage, and repeated requests are idempotent. Each included phase fully replaces its existing stored series; the supplied date range is not merged with previously stored dates. Each top-level well record is atomic during conflict validation: if any submitted phase conflicts, no phase from that well record is written and every conflicting phase is reported. The client may resubmit a well record containing only the non-conflicting phases; omitted phases remain unchanged. Monthly values count toward the limits after calendar-aware daily expansion. Each phase is limited to 20,000 daily-equivalent forecast volume values, and the complete request is limited to 100,000 daily-equivalent forecast volume values. The request body may be one well record or an array of well records. A facility or a proposed well is refused like a well that is not in the forecast.
ForecastVolumesWriteMultiStatusResponse result = apiInstance.PutForecastMonthlyVolumes(projectId, forecastId, forecastVolumes);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling MonthlyVolumesApi.PutForecastMonthlyVolumes: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | string | ||
| forecastId | string | ||
| forecastVolumes | List<ForecastVolumesInput> | A single forecast volume input or an array of forecast volume inputs. | [Max number of items is 200] |
ForecastVolumesWriteMultiStatusResponse
API Key, Service Account
| Status code | Description | Response headers | |————-|————-|——————| | 207 | Multi-Status | - | | 404 | The volumetric forecast feature is not enabled. | - | | 413 | The request exceeds the 20,000 daily-equivalent forecast volume value limit for a phase or the 100,000 daily-equivalent forecast volume value limit for the complete request. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]