combocurve-client-csharp

Logo

C# client for the ComboCurve REST API

View the Project on GitHub insidepetroleum/combocurve-client-csharp

ComboCurve.Api.Api.ScenarioEconModelAssignmentsApi

All URIs are relative to https://api.combocurve.com

Method HTTP request Description
DeleteScenarioEconModelAssignments DELETE /v1/projects/{projectId}/scenarios/{scenarioId}/assignments/econ-models Clears econ model assignments. Each record clears one column and qualifier for `wellIds` or `allWells`; with `econModelId`, only slots holding that econ model are cleared. 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.
GetScenarioEconModelAssignments GET /v1/projects/{projectId}/scenarios/{scenarioId}/assignments/econ-models Returns econ model assignments for the scenario, grouped by well. Reads each well's base row unless `incrementalIndex` is given. Forecast and p-series assignments are served by `…/assignments/models`.
PutScenarioEconModelAssignments PUT /v1/projects/{projectId}/scenarios/{scenarioId}/assignments/econ-models Assigns econ models to wells in the scenario. Each record assigns one econ model, 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. 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.

DeleteScenarioEconModelAssignments

void DeleteScenarioEconModelAssignments (string projectId, string scenarioId, List econModelAssignments = null)

Clears econ model assignments. Each record clears one column and qualifier for wellIds or allWells; with econModelId, only slots holding that econ model are cleared. 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.

Example

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 DeleteScenarioEconModelAssignmentsExample
    {
        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 ScenarioEconModelAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var econModelAssignments = new List<EconModelAssignmentDelete>(); // List<EconModelAssignmentDelete> | Econ model assignment record(s) to clear. (optional) 

            try
            {
                // Clears econ model assignments. Each record clears one column and qualifier for `wellIds` or `allWells`; with `econModelId`, only slots holding that econ model are cleared. 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.DeleteScenarioEconModelAssignments(projectId, scenarioId, econModelAssignments);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ScenarioEconModelAssignmentsApi.DeleteScenarioEconModelAssignments: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
econModelAssignments List<EconModelAssignmentDelete> Econ model assignment record(s) to clear. [optional] [Max number of items is 500]

Return type

void (empty response body)

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| 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]

GetScenarioEconModelAssignments

ICollection<EconModelWellAssignment> GetScenarioEconModelAssignments (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 econ model assignments for the scenario, grouped by well. Reads each well’s base row unless incrementalIndex is given. Forecast and p-series assignments are served by .../assignments/models.

Example

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 GetScenarioEconModelAssignmentsExample
    {
        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 ScenarioEconModelAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var model = "model_example";  // List<string> | Filter by econ model type(s) (API camelCase name). (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 econ model assignments for the scenario, grouped by well. Reads each well's base row unless `incrementalIndex` is given. Forecast and p-series assignments are served by `.../assignments/models`.
                ICollection<EconModelWellAssignment> result = apiInstance.GetScenarioEconModelAssignments(projectId, scenarioId, model, qualifierName, wellId, incrementalIndex, take, skip, cursor);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ScenarioEconModelAssignmentsApi.GetScenarioEconModelAssignments: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
model List<string> Filter by econ model type(s) (API camelCase name). [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]

Return type

ICollection<EconModelWellAssignment>

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| 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]

PutScenarioEconModelAssignments

EconModelAssignmentMultiStatusResponse PutScenarioEconModelAssignments (string projectId, string scenarioId, List econModelAssignments = null)

Assigns econ models to wells in the scenario. Each record assigns one econ model, 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. 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.

Example

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 PutScenarioEconModelAssignmentsExample
    {
        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 ScenarioEconModelAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var econModelAssignments = new List<EconModelAssignmentInput>(); // List<EconModelAssignmentInput> | Econ model assignment record(s). (optional) 

            try
            {
                // Assigns econ models to wells in the scenario. Each record assigns one econ model, 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. 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.
                EconModelAssignmentMultiStatusResponse result = apiInstance.PutScenarioEconModelAssignments(projectId, scenarioId, econModelAssignments);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ScenarioEconModelAssignmentsApi.PutScenarioEconModelAssignments: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
econModelAssignments List<EconModelAssignmentInput> Econ model assignment record(s). [optional] [Max number of items is 500]

Return type

EconModelAssignmentMultiStatusResponse

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| 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]