combocurve-client-csharp

Logo

C# client for the ComboCurve REST API

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

ComboCurve.Api.Api.EconModelsAssignmentsApi

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

Method HTTP request Description
DeleteEconModelAssignmentDelete DELETE /v1/projects/{projectId}/econ-models/{econName}/{econModelId}/assignments Removes the econ model assignment from wells of a scenario. For every `econName` except `general_options`, `qualifierName` and `wells` or `allWells` are required. `incrementalIndex` is a whole number of 0 or more. When it is omitted or `0`, the base row of each well is cleared. A scenario that is not in the project, or a `qualifierName` that the scenario does not have, returns 404.
GetEconModelsAssignmentsRead GET /v1/projects/{projectId}/econ-models/{econName}/{econModelId}/assignments Returns the scenarios and wells that the econ model is assigned to, one record per scenario and qualifier. Records are sorted by `scenario`. `wells` and `scenarios` filter the result.
HeadEconModelsAssignmentsCount HEAD /v1/projects/{projectId}/econ-models/{econName}/{econModelId}/assignments Returns the number of assignments of the econ model in `X-Query-Count`, without a body. Supports the same filters as GET.
PostEconModelAssignmentUpsert POST /v1/projects/{projectId}/econ-models/{econName}/{econModelId}/assignments Assigns the econ model to wells of scenarios, one record per payload item. The response is 207 Multi-Status with one result per item. A scenario that is not in the project, or a `qualifierName` that the scenario does not have, gives a 404 result for that item. For every `econName` except `general_options`, each item needs `scenario`, `qualifierName` and `wells` or `allWells`. For `general_options` the econ model is assigned to the scenario and only `scenario` is needed. `incrementalIndex` is a whole number of 0 or more. When it is omitted or `0`, the base row of each well is assigned.
PutEconModelAssignmentUpsert PUT /v1/projects/{projectId}/econ-models/{econName}/{econModelId}/assignments Same as POST.

DeleteEconModelAssignmentDelete

void DeleteEconModelAssignmentDelete (string projectId, string econName, string econModelId, string scenarioId, string qualifierName = null, string wells = null, bool? allWells = null, int? incrementalIndex = null)

Removes the econ model assignment from wells of a scenario. For every econName except general_options, qualifierName and wells or allWells are required. incrementalIndex is a whole number of 0 or more. When it is omitted or 0, the base row of each well is cleared. A scenario that is not in the project, or a qualifierName that the scenario does not have, returns 404.

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 DeleteEconModelAssignmentDeleteExample
    {
        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 EconModelsAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | The project id.
            var econName = "econName_example";  // string | The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.
            var econModelId = "econModelId_example";  // string | The econ model id. It must be a model of the project or a company model.
            var scenarioId = "scenarioId_example";  // string | The scenario id.
            var qualifierName = "qualifierName_example";  // string | The name of the qualifier in the scenario. Required unless `econName` is `general_options`. (optional)
            var wells = new string[] { "wells_example" };  // IEnumerable<string> | The well ids to remove the assignment from. Required unless `allWells` is true or `econName` is `general_options`. (optional)
            var allWells = true;  // bool? | Set to `true` to remove the assignment from every well of the scenario. Send `wells` to remove it from specific wells. Sending `false` without `wells` is rejected with a 400. (optional)
            var incrementalIndex = 56;  // int? | The incremental row to clear. When it is omitted or `0`, the base row of each well is cleared. (optional)

            try
            {
                // Removes the econ model assignment from wells of a scenario. For every `econName` except `general_options`, `qualifierName` and `wells` or `allWells` are required. `incrementalIndex` is a whole number of 0 or more. When it is omitted or `0`, the base row of each well is cleared. A scenario that is not in the project, or a `qualifierName` that the scenario does not have, returns 404.
                apiInstance.DeleteEconModelAssignmentDelete(projectId, econName, econModelId, scenarioId, qualifierName, wells, allWells, incrementalIndex);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EconModelsAssignmentsApi.DeleteEconModelAssignmentDelete: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string The project id.  
econName string The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.  
econModelId string The econ model id. It must be a model of the project or a company model.  
scenarioId string The scenario id.  
qualifierName string The name of the qualifier in the scenario. Required unless `econName` is `general_options`. [optional]
wells string The well ids to remove the assignment from. Required unless `allWells` is true or `econName` is `general_options`. [optional]
allWells bool? Set to `true` to remove the assignment from every well of the scenario. Send `wells` to remove it from specific wells. Sending `false` without `wells` is rejected with a 400. [optional]
incrementalIndex int? The incremental row to clear. When it is omitted or `0`, the base row of each well is cleared. [optional]

Return type

void (empty response body)

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 204 | NoContent Response | * x-delete-count - | | 400 | Bad Request. There is something wrong with the request data, for example an unknown `econName` (`InvalidEconName`), an econ model that is not in the project (`EconModelNotFound`) or is of another type (`EconTypeMismatch`), an `econName` that is assigned through the scenario `models` endpoint instead (`UnsupportedAssignmentColumn`), or a missing required field. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 404 | Not Found. The scenario or the qualifier does not exist in the project. | - | | 429 | Too Many Requests. The read or write request rate limit for the project was exceeded. Wait and retry. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEconModelsAssignmentsRead

ICollection<EconModelsAssignmentsReadOKResponse> GetEconModelsAssignmentsRead (string projectId, string econName, string econModelId, int? skip = null, int? take = null, string wells = null, string scenarios = null, string sort = null)

Returns the scenarios and wells that the econ model is assigned to, one record per scenario and qualifier. Records are sorted by scenario. wells and scenarios filter the result.

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 GetEconModelsAssignmentsReadExample
    {
        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 EconModelsAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | The project id.
            var econName = "econName_example";  // string | The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.
            var econModelId = "econModelId_example";  // string | The econ model id. It must be a model of the project or a company model.
            var skip = 56;  // int? | number of items to skip (optional) (default to 0)
            var take = 56;  // int? | max records to return (optional) (default to 100) (between 1 and 200)
            var wells = new string[] { "wells_example" };  // IEnumerable<string> | Only count or return assignments of these well ids. (optional)
            var scenarios = new string[] { "scenarios_example" };  // IEnumerable<string> | Only count or return assignments of these scenario ids. (optional)
            var sort = "sort_example";  // string | field to sort by, including + or - at the beginning for ascending or descending order, respectively (optional)

            try
            {
                // Returns the scenarios and wells that the econ model is assigned to, one record per scenario and qualifier. Records are sorted by `scenario`. `wells` and `scenarios` filter the result.
                ICollection<EconModelsAssignmentsReadOKResponse> result = apiInstance.GetEconModelsAssignmentsRead(projectId, econName, econModelId, skip, take, wells, scenarios, sort);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EconModelsAssignmentsApi.GetEconModelsAssignmentsRead: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string The project id.  
econName string The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.  
econModelId string The econ model id. It must be a model of the project or a company model.  
skip int? number of items to skip [optional] [default to 0]
take int? max records to return [optional] [default to 100] [between 1 and 200]
wells string Only count or return assignments of these well ids. [optional]
scenarios string Only count or return assignments of these scenario ids. [optional]
sort string field to sort by, including + or - at the beginning for ascending or descending order, respectively [optional]

Return type

ICollection<EconModelsAssignmentsReadOKResponse>

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK Response | * 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 | BadRequest Response | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 404 | Not Found. The project does not exist. | - | | 429 | Too Many Requests. The read or write request rate limit for the project was exceeded. Wait and retry. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

HeadEconModelsAssignmentsCount

void HeadEconModelsAssignmentsCount (string projectId, string econName, string econModelId, string wells = null, string scenarios = null)

Returns the number of assignments of the econ model in X-Query-Count, without a body. Supports the same filters as GET.

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 HeadEconModelsAssignmentsCountExample
    {
        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 EconModelsAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | The project id.
            var econName = "econName_example";  // string | The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.
            var econModelId = "econModelId_example";  // string | The econ model id. It must be a model of the project or a company model.
            var wells = new string[] { "wells_example" };  // IEnumerable<string> | Only count or return assignments of these well ids. (optional)
            var scenarios = new string[] { "scenarios_example" };  // IEnumerable<string> | Only count or return assignments of these scenario ids. (optional)

            try
            {
                // Returns the number of assignments of the econ model in `X-Query-Count`, without a body. Supports the same filters as GET.
                apiInstance.HeadEconModelsAssignmentsCount(projectId, econName, econModelId, wells, scenarios);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EconModelsAssignmentsApi.HeadEconModelsAssignmentsCount: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string The project id.  
econName string The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.  
econModelId string The econ model id. It must be a model of the project or a company model.  
wells string Only count or return assignments of these well ids. [optional]
scenarios string Only count or return assignments of these scenario ids. [optional]

Return type

void (empty response body)

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK Response | * X-Query-Count - | | 400 | BadRequest Response | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostEconModelAssignmentUpsert

EconModelAssignmentUpsertMultiStatusResponse PostEconModelAssignmentUpsert (string projectId, string econName, string econModelId, List payload)

Assigns the econ model to wells of scenarios, one record per payload item. The response is 207 Multi-Status with one result per item. A scenario that is not in the project, or a qualifierName that the scenario does not have, gives a 404 result for that item. For every econName except general_options, each item needs scenario, qualifierName and wells or allWells. For general_options the econ model is assigned to the scenario and only scenario is needed. incrementalIndex is a whole number of 0 or more. When it is omitted or 0, the base row of each well is assigned.

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 PostEconModelAssignmentUpsertExample
    {
        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 EconModelsAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | The project id.
            var econName = "econName_example";  // string | The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.
            var econModelId = "econModelId_example";  // string | The econ model id. It must be a model of the project or a company model.
            var payload = new List<EconModelAssignmentUpsertPayload>(); // List<EconModelAssignmentUpsertPayload> | 

            try
            {
                // Assigns the econ model to wells of scenarios, one record per payload item. The response is 207 Multi-Status with one result per item. A scenario that is not in the project, or a `qualifierName` that the scenario does not have, gives a 404 result for that item. For every `econName` except `general_options`, each item needs `scenario`, `qualifierName` and `wells` or `allWells`. For `general_options` the econ model is assigned to the scenario and only `scenario` is needed. `incrementalIndex` is a whole number of 0 or more. When it is omitted or `0`, the base row of each well is assigned.
                EconModelAssignmentUpsertMultiStatusResponse result = apiInstance.PostEconModelAssignmentUpsert(projectId, econName, econModelId, payload);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EconModelsAssignmentsApi.PostEconModelAssignmentUpsert: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string The project id.  
econName string The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.  
econModelId string The econ model id. It must be a model of the project or a company model.  
payload List<EconModelAssignmentUpsertPayload>   [Max number of items is 500]

Return type

EconModelAssignmentUpsertMultiStatusResponse

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 207 | MultiStatus Response | - | | 400 | Bad Request. There is something wrong with the request data, for example an unknown `econName` (`InvalidEconName`), an econ model that is not in the project (`EconModelNotFound`) or is of another type (`EconTypeMismatch`), an `econName` that is assigned through the scenario `models` endpoint instead (`UnsupportedAssignmentColumn`), or a missing required field. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 404 | Not Found. The project does not exist. | - | | 429 | Too Many Requests. The read or write request rate limit for the project was exceeded. Wait and retry. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutEconModelAssignmentUpsert

EconModelAssignmentUpsertMultiStatusResponse PutEconModelAssignmentUpsert (string projectId, string econName, string econModelId, List payload)

Same as POST.

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 PutEconModelAssignmentUpsertExample
    {
        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 EconModelsAssignmentsApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | The project id.
            var econName = "econName_example";  // string | The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.
            var econModelId = "econModelId_example";  // string | The econ model id. It must be a model of the project or a company model.
            var payload = new List<EconModelAssignmentUpsertPayload>(); // List<EconModelAssignmentUpsertPayload> | 

            try
            {
                // Same as POST.
                EconModelAssignmentUpsertMultiStatusResponse result = apiInstance.PutEconModelAssignmentUpsert(projectId, econName, econModelId, payload);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling EconModelsAssignmentsApi.PutEconModelAssignmentUpsert: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string The project id.  
econName string The econ model type, matched without regard to case. Accepted values are `capex`, `dates`, `differentials`, `emission`, `expenses`, `operations`, `ownership_reversion`, `pricing`, `production_taxes`, `production_vs_fit`, `reserves_category`, `risking`, `stream_properties` and `general_options`. Common aliases such as `ownershipReversion` and `productionTaxes` are also accepted. The econ model in `econModelId` must be of this type.  
econModelId string The econ model id. It must be a model of the project or a company model.  
payload List<EconModelAssignmentUpsertPayload>   [Max number of items is 500]

Return type

EconModelAssignmentUpsertMultiStatusResponse

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 207 | MultiStatus Response | - | | 400 | Bad Request. There is something wrong with the request data, for example an unknown `econName` (`InvalidEconName`), an econ model that is not in the project (`EconModelNotFound`) or is of another type (`EconTypeMismatch`), an `econName` that is assigned through the scenario `models` endpoint instead (`UnsupportedAssignmentColumn`), or a missing required field. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 404 | Not Found. The project does not exist. | - | | 429 | Too Many Requests. The read or write request rate limit for the project was exceeded. Wait and retry. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]