combocurve-client-csharp

Logo

C# client for the ComboCurve REST API

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

ComboCurve.Api.Api.UserResourceRolesApi

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

Method HTTP request Description
GetUsersRoles GET /v1/users/roles Returns a list of user resource role documents.

GetUsersRoles

ICollection<UserResourceRoles> GetUsersRoles (int? skip = null, string sort = null, string cursor = null, int? take = null, string userId = null, string email = null, string project = null, string role = null)

Returns a list of user resource role documents.

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 GetUsersRolesExample
    {
        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 UserResourceRolesApi(serviceAccount, apiKey);

            var skip = 56;  // int? | number of items to skip. Cannot be combined with `cursor`; sending both returns 400. (optional) (default to 0)
            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 take = 56;  // int? | max records to return (optional) (default to 25) (between 1 and 25)
            var userId = "userId_example";  // string | filter by userId (optional)
            var email = "email_example";  // string | filter by user email (optional)
            var project = "project_example";  // string | filter by project (optional)
            var role = "role_example";  // string | filter by role (optional)

            try
            {
                // Returns a list of user resource role documents.
                ICollection<UserResourceRoles> result = apiInstance.GetUsersRoles(skip, sort, cursor, take, userId, email, project, role);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UserResourceRolesApi.GetUsersRoles: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
skip int? number of items to skip. Cannot be combined with `cursor`; sending both returns 400. [optional] [default to 0]
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]
take int? max records to return [optional] [default to 25] [between 1 and 25]
userId string filter by userId [optional]
email string filter by user email [optional]
project string filter by project [optional]
role string filter by role [optional]

Return type

ICollection<UserResourceRoles>

Authorization

API Key, Service Account

HTTP request headers

HTTP response details

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

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