combocurve-client-csharp

Logo

C# client for the ComboCurve REST API

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

ComboCurve.Api.Api.ProjectScenarioFacilityNetworksApi

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

Method HTTP request Description
DeleteProjectScenarioFacilityNetworks DELETE /v1/projects/{projectId}/scenarios/{scenarioId}/facility-networks Deletes the facility networks that match `id` or `name`, with their well groups (never the wells in them). Facilities stay in the scenario. `X-Delete-Count` is the number of networks deleted.
GetProjectScenarioFacilityNetworkEffectiveAllocations GET /v1/projects/{projectId}/scenarios/{scenarioId}/facility-networks/{networkId}/effective-allocations Returns what an economics run would route through the network: the share of every stream that each well group delivers to each facility, after composing the allocations along every path, and each facility's depth (the number of facilities between it and the well groups, taking the longest path). The composition is done by the economics engine itself, so the answer is what a run would do. Percentages are of the well group's volume, so a facility fed by two paths can receive more than any single edge allocates. A pair the run routes nothing between is listed at 0%. A `dates` allocation lists the value from each date, and `valueBeforeFirstDate` is what applies before the first. `warnings` lists what the stored network fails to satisfy, such as allocations that total more than 100%; an unconfigured edge counts as 0%.
GetProjectScenarioFacilityNetworks GET /v1/projects/{projectId}/scenarios/{scenarioId}/facility-networks Returns the facility networks of the scenario, ordered by name. A well group lists its member count, never its wells.
HeadProjectScenarioFacilityNetworks HEAD /v1/projects/{projectId}/scenarios/{scenarioId}/facility-networks Returns the number of facility networks of the scenario in `X-Query-Count`, without a body.
PatchProjectScenarioFacilityNetworks PATCH /v1/projects/{projectId}/scenarios/{scenarioId}/facility-networks Changes the allocations of existing edges and nothing else. An edge is matched by its `from`, `to` and `role` (primary when omitted), and a stream in the body replaces that stream on the edge; the edge's other streams and every other edge stay as they are. An edge no stored edge matches, or a stream the edge does not already have, is refused. The result is validated and saved like a PUT, so the allocations of a node's outgoing edges must still not total more than 100% for any stream.
PostProjectScenarioFacilityNetworks POST /v1/projects/{projectId}/scenarios/{scenarioId}/facility-networks Creates facility networks in the scenario. A network is identified by its name, and a name already used in the scenario is refused. The facilities a network names must exist in the project; they are added to the scenario. Well groups are created empty, and their wells are written through the well-group endpoints. The edge allocations of a source must not total more than 100% for any stream and date, as in the app; a total below 100% is accepted.
PutProjectScenarioFacilityNetworks PUT /v1/projects/{projectId}/scenarios/{scenarioId}/facility-networks Updates the network of the given `name`, or creates it. A network read from the API can be written back as it is: read-only fields (`id`, `createdAt`, `updatedAt`, a well group's `id` and `wellCount`) are ignored, and a write that changes nothing is reported with status `Unchanged` and leaves `updatedAt` as it was. Well groups are matched by name: a match keeps its id and its wells and changes only its settings, a new name adds an empty group, and a name left out deletes the group with its wells. To rename a group, use the well-group endpoint, since a changed name here is a new group. A body with the same well group name twice, or a stored network whose groups have blank or repeated names, is refused. `newName` renames the network. A facility's `capacityModel` names an operations model with facility capacity rows (oil, gas or water, in bbl/d or mcf/d, flat, dated or seasonal); it is assigned on the scenario's active operations qualifier, a project model taking precedence over a company one with the same name. Leaving it out never removes a capacity. Wells are never written here. Integrations and the canvas can overlap: a save from a canvas opened before this write replaces it.

DeleteProjectScenarioFacilityNetworks

void DeleteProjectScenarioFacilityNetworks (string projectId, string scenarioId, string id = null, string name = null)

Deletes the facility networks that match id or name, with their well groups (never the wells in them). Facilities stay in the scenario. X-Delete-Count is the number of networks deleted.

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 DeleteProjectScenarioFacilityNetworksExample
    {
        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 ProjectScenarioFacilityNetworksApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var id = new string[] { "id_example" };  // IEnumerable<string> | filter by id (optional)
            var name = new string[] { "name_example" };  // IEnumerable<string> | filter by name (optional)

            try
            {
                // Deletes the facility networks that match `id` or `name`, with their well groups (never the wells in them). Facilities stay in the scenario. `X-Delete-Count` is the number of networks deleted.
                apiInstance.DeleteProjectScenarioFacilityNetworks(projectId, scenarioId, id, name);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ProjectScenarioFacilityNetworksApi.DeleteProjectScenarioFacilityNetworks: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
id string filter by id [optional]
name string filter by name [optional]

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. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 403 | Forbidden. Facility networks are not enabled for the company. | - | | 404 | Not Found. The project or the scenario does not exist. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

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

GetProjectScenarioFacilityNetworkEffectiveAllocations

FacilityNetworkEffectiveAllocations GetProjectScenarioFacilityNetworkEffectiveAllocations (string projectId, string scenarioId, string networkId)

Returns what an economics run would route through the network: the share of every stream that each well group delivers to each facility, after composing the allocations along every path, and each facility’s depth (the number of facilities between it and the well groups, taking the longest path). The composition is done by the economics engine itself, so the answer is what a run would do. Percentages are of the well group’s volume, so a facility fed by two paths can receive more than any single edge allocates. A pair the run routes nothing between is listed at 0%. A dates allocation lists the value from each date, and valueBeforeFirstDate is what applies before the first. warnings lists what the stored network fails to satisfy, such as allocations that total more than 100%; an unconfigured edge counts as 0%.

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 GetProjectScenarioFacilityNetworkEffectiveAllocationsExample
    {
        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 ProjectScenarioFacilityNetworksApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var networkId = "networkId_example";  // string | 

            try
            {
                // Returns what an economics run would route through the network: the share of every stream that each well group delivers to each facility, after composing the allocations along every path, and each facility's depth (the number of facilities between it and the well groups, taking the longest path). The composition is done by the economics engine itself, so the answer is what a run would do. Percentages are of the well group's volume, so a facility fed by two paths can receive more than any single edge allocates. A pair the run routes nothing between is listed at 0%. A `dates` allocation lists the value from each date, and `valueBeforeFirstDate` is what applies before the first. `warnings` lists what the stored network fails to satisfy, such as allocations that total more than 100%; an unconfigured edge counts as 0%.
                FacilityNetworkEffectiveAllocations result = apiInstance.GetProjectScenarioFacilityNetworkEffectiveAllocations(projectId, scenarioId, networkId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ProjectScenarioFacilityNetworksApi.GetProjectScenarioFacilityNetworkEffectiveAllocations: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
networkId string    

Return type

FacilityNetworkEffectiveAllocations

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| | 200 | OK | - | | 400 | Bad Request. There is something wrong with the request data. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 403 | Forbidden. Facility networks are not enabled for the company. | - | | 404 | Not Found. The project, scenario or network does not exist. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

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

GetProjectScenarioFacilityNetworks

ICollection<FacilityNetwork> GetProjectScenarioFacilityNetworks (string projectId, string scenarioId, int? skip = null, int? take = null, string id = null, string name = null)

Returns the facility networks of the scenario, ordered by name. A well group lists its member count, never its wells.

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 GetProjectScenarioFacilityNetworksExample
    {
        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 ProjectScenarioFacilityNetworksApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_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 100)
            var id = new string[] { "id_example" };  // IEnumerable<string> | filter by id (optional)
            var name = new string[] { "name_example" };  // IEnumerable<string> | filter by name (optional)

            try
            {
                // Returns the facility networks of the scenario, ordered by name. A well group lists its member count, never its wells.
                ICollection<FacilityNetwork> result = apiInstance.GetProjectScenarioFacilityNetworks(projectId, scenarioId, skip, take, id, name);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ProjectScenarioFacilityNetworksApi.GetProjectScenarioFacilityNetworks: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId 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 100]
id string filter by id [optional]
name string filter by name [optional]

Return type

ICollection<FacilityNetwork>

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

| 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. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 403 | Forbidden. Facility networks are not enabled for the company. | - | | 404 | Not Found. The project or the scenario 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]

HeadProjectScenarioFacilityNetworks

void HeadProjectScenarioFacilityNetworks (string projectId, string scenarioId, int? skip = null, int? take = null, string id = null, string name = null)

Returns the number of facility networks of the scenario in X-Query-Count, without a body.

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 HeadProjectScenarioFacilityNetworksExample
    {
        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 ProjectScenarioFacilityNetworksApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_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 100)
            var id = new string[] { "id_example" };  // IEnumerable<string> | filter by id (optional)
            var name = new string[] { "name_example" };  // IEnumerable<string> | filter by name (optional)

            try
            {
                // Returns the number of facility networks of the scenario in `X-Query-Count`, without a body.
                apiInstance.HeadProjectScenarioFacilityNetworks(projectId, scenarioId, skip, take, id, name);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ProjectScenarioFacilityNetworksApi.HeadProjectScenarioFacilityNetworks: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId 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 100]
id string filter by id [optional]
name string filter by name [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 | * 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. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 403 | Forbidden. Facility networks are not enabled for the company. | - | | 404 | Not Found. The project or the scenario does not exist. | - | | 500 | Internal Server Error. Something went wrong on the server. | - |

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

PatchProjectScenarioFacilityNetworks

FacilityNetworkMultiStatusResponse PatchProjectScenarioFacilityNetworks (string projectId, string scenarioId, List allocationPatch = null)

Changes the allocations of existing edges and nothing else. An edge is matched by its from, to and role (primary when omitted), and a stream in the body replaces that stream on the edge; the edge’s other streams and every other edge stay as they are. An edge no stored edge matches, or a stream the edge does not already have, is refused. The result is validated and saved like a PUT, so the allocations of a node’s outgoing edges must still not total more than 100% for any stream.

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 PatchProjectScenarioFacilityNetworksExample
    {
        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 ProjectScenarioFacilityNetworksApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var allocationPatch = new List<FacilityNetworkAllocationPatch>(); // List<FacilityNetworkAllocationPatch> | Networks to update. See FacilityNetworkAllocationPatchList. (optional) 

            try
            {
                // Changes the allocations of existing edges and nothing else. An edge is matched by its `from`, `to` and `role` (primary when omitted), and a stream in the body replaces that stream on the edge; the edge's other streams and every other edge stay as they are. An edge no stored edge matches, or a stream the edge does not already have, is refused. The result is validated and saved like a PUT, so the allocations of a node's outgoing edges must still not total more than 100% for any stream.
                FacilityNetworkMultiStatusResponse result = apiInstance.PatchProjectScenarioFacilityNetworks(projectId, scenarioId, allocationPatch);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ProjectScenarioFacilityNetworksApi.PatchProjectScenarioFacilityNetworks: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
allocationPatch List<FacilityNetworkAllocationPatch> Networks to update. See FacilityNetworkAllocationPatchList. [optional] [Max number of items is 25]

Return type

FacilityNetworkMultiStatusResponse

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. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 403 | Forbidden. Facility networks are not enabled for the company. | - | | 404 | Not Found. The project or the scenario 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]

PostProjectScenarioFacilityNetworks

FacilityNetworkMultiStatusResponse PostProjectScenarioFacilityNetworks (string projectId, string scenarioId, List facilityNetwork = null)

Creates facility networks in the scenario. A network is identified by its name, and a name already used in the scenario is refused. The facilities a network names must exist in the project; they are added to the scenario. Well groups are created empty, and their wells are written through the well-group endpoints. The edge allocations of a source must not total more than 100% for any stream and date, as in the app; a total below 100% is accepted.

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 PostProjectScenarioFacilityNetworksExample
    {
        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 ProjectScenarioFacilityNetworksApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var facilityNetwork = new List<FacilityNetworkInput>(); // List<FacilityNetworkInput> | Facility networks to create. See FacilityNetworkInputList. (optional) 

            try
            {
                // Creates facility networks in the scenario. A network is identified by its name, and a name already used in the scenario is refused. The facilities a network names must exist in the project; they are added to the scenario. Well groups are created empty, and their wells are written through the well-group endpoints. The edge allocations of a source must not total more than 100% for any stream and date, as in the app; a total below 100% is accepted.
                FacilityNetworkMultiStatusResponse result = apiInstance.PostProjectScenarioFacilityNetworks(projectId, scenarioId, facilityNetwork);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ProjectScenarioFacilityNetworksApi.PostProjectScenarioFacilityNetworks: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
facilityNetwork List<FacilityNetworkInput> Facility networks to create. See FacilityNetworkInputList. [optional] [Max number of items is 25]

Return type

FacilityNetworkMultiStatusResponse

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. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 403 | Forbidden. Facility networks are not enabled for the company. | - | | 404 | Not Found. The project or the scenario 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]

PutProjectScenarioFacilityNetworks

FacilityNetworkMultiStatusResponse PutProjectScenarioFacilityNetworks (string projectId, string scenarioId, List facilityNetwork = null)

Updates the network of the given name, or creates it. A network read from the API can be written back as it is: read-only fields (id, createdAt, updatedAt, a well group’s id and wellCount) are ignored, and a write that changes nothing is reported with status Unchanged and leaves updatedAt as it was. Well groups are matched by name: a match keeps its id and its wells and changes only its settings, a new name adds an empty group, and a name left out deletes the group with its wells. To rename a group, use the well-group endpoint, since a changed name here is a new group. A body with the same well group name twice, or a stored network whose groups have blank or repeated names, is refused. newName renames the network. A facility’s capacityModel names an operations model with facility capacity rows (oil, gas or water, in bbl/d or mcf/d, flat, dated or seasonal); it is assigned on the scenario’s active operations qualifier, a project model taking precedence over a company one with the same name. Leaving it out never removes a capacity. Wells are never written here. Integrations and the canvas can overlap: a save from a canvas opened before this write replaces it.

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 PutProjectScenarioFacilityNetworksExample
    {
        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 ProjectScenarioFacilityNetworksApi(serviceAccount, apiKey);

            var projectId = "projectId_example";  // string | 
            var scenarioId = "scenarioId_example";  // string | 
            var facilityNetwork = new List<FacilityNetworkInput>(); // List<FacilityNetworkInput> | Facility networks to update or create. See FacilityNetworkInputList. (optional) 

            try
            {
                // Updates the network of the given `name`, or creates it. A network read from the API can be written back as it is: read-only fields (`id`, `createdAt`, `updatedAt`, a well group's `id` and `wellCount`) are ignored, and a write that changes nothing is reported with status `Unchanged` and leaves `updatedAt` as it was. Well groups are matched by name: a match keeps its id and its wells and changes only its settings, a new name adds an empty group, and a name left out deletes the group with its wells. To rename a group, use the well-group endpoint, since a changed name here is a new group. A body with the same well group name twice, or a stored network whose groups have blank or repeated names, is refused. `newName` renames the network. A facility's `capacityModel` names an operations model with facility capacity rows (oil, gas or water, in bbl/d or mcf/d, flat, dated or seasonal); it is assigned on the scenario's active operations qualifier, a project model taking precedence over a company one with the same name. Leaving it out never removes a capacity. Wells are never written here. Integrations and the canvas can overlap: a save from a canvas opened before this write replaces it.
                FacilityNetworkMultiStatusResponse result = apiInstance.PutProjectScenarioFacilityNetworks(projectId, scenarioId, facilityNetwork);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling ProjectScenarioFacilityNetworksApi.PutProjectScenarioFacilityNetworks: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
projectId string    
scenarioId string    
facilityNetwork List<FacilityNetworkInput> Facility networks to update or create. See FacilityNetworkInputList. [optional] [Max number of items is 25]

Return type

FacilityNetworkMultiStatusResponse

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. | - | | 401 | Unauthorized. Invalid or missing authentication. | - | | 403 | Forbidden. Facility networks are not enabled for the company. | - | | 404 | Not Found. The project or the scenario 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]