conductoroneapi

package module
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 28 Imported by: 2

README

conductorone-api

SDK Installation

go get github.com/conductorone/conductorone-sdk-go

SDK Example Usage

package main

import(
	"context"
	"log"
	"github.com/conductorone/conductorone-sdk-go"
	"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
)

func main() {
    s := conductoroneapi.New(
        conductoroneapi.WithSecurity(shared.Security{
            Oauth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.AppEntitlementSearch.Search(ctx, shared.AppEntitlementSearchServiceSearchRequest{
        AppEntitlementExpandMask: &shared.AppEntitlementExpandMask{
            Paths: []string{
                "provident",
                "distinctio",
                "quibusdam",
            },
        },
        AccessReviewID: conductoroneapi.String("unde"),
        Alias: conductoroneapi.String("nulla"),
        AppIds: []string{
            "illum",
            "vel",
            "error",
        },
        AppUserIds: []string{
            "suscipit",
            "iure",
            "magnam",
        },
        ComplianceFrameworkIds: []string{
            "ipsa",
            "delectus",
            "tempora",
            "suscipit",
        },
        ExcludeAppIds: []string{
            "minus",
            "placeat",
        },
        ExcludeAppUserIds: []string{
            "iusto",
            "excepturi",
            "nisi",
        },
        OnlyGetExpiring: conductoroneapi.Bool(false),
        PageSize: conductoroneapi.Float64(9255.97),
        PageToken: conductoroneapi.String("temporibus"),
        Query: conductoroneapi.String("ab"),
        ResourceTypeIds: []string{
            "veritatis",
            "deserunt",
        },
        RiskLevelIds: []string{
            "ipsam",
        },
    })
    if err != nil {
        log.Fatal(err)
    }

    if res.AppEntitlementSearchServiceSearchResponse != nil {
        // handle response
    }
}

Available Resources and Operations

AppEntitlementSearch
AppEntitlementUserBinding
AppEntitlements
AppOwners
AppReport
AppReportAction
AppResource
AppResourceOwners
AppResourceSearch
AppResourceType
AppSearch
AppUsageControls
Apps
Auth
Connector
Directory
PersonalClient
Policies
PolicySearch
RequestCatalogManagement
RequestCatalogSearch
Roles
Task
TaskActions
TaskSearch
User
UserSearch
Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !

SDK Created by Speakeasy

Documentation

Index

Constants

View Source
const ClientIdGolangSDK = "2RCzHlak5q7CY14SdBc8HoZEJRf"

Variables

View Source
var (
	ErrInvalidClientSecret = errors.New("invalid client secret")
	ErrInvalidClientID     = errors.New("invalid client id")
)
View Source
var ServerList = []string{

	"https://{tenantDomain}.conductor.one",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func NewTokenSource added in v1.6.1

func NewTokenSource(ctx context.Context, clientID string, clientSecret string, hostOverride string) (oauth2.TokenSource, error)

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type ClientCredentials added in v1.1.1

type ClientCredentials struct {
	ClientID     string
	ClientSecret string
}

func LoginFlow added in v1.1.1

func LoginFlow(
	ctx context.Context,
	tenantName string,
	clientID string,
	personalClientCredentialDisplayName string,
	cb func(validateDetails *DeviceCodeResponse) error,
) (*ClientCredentials, error)

type ConductoroneAPI

type ConductoroneAPI struct {
	AppEntitlementSearch      *appEntitlementSearch
	AppEntitlementUserBinding *appEntitlementUserBinding
	AppEntitlements           *appEntitlements
	AppOwners                 *appOwners
	AppReport                 *appReport
	AppReportAction           *appReportAction
	AppResource               *appResource
	AppResourceOwners         *appResourceOwners
	AppResourceSearch         *appResourceSearch
	AppResourceType           *appResourceType
	AppSearch                 *appSearch
	AppUsageControls          *appUsageControls
	Apps                      *apps
	Auth                      *auth
	Connector                 *connector
	Directory                 *directory
	PersonalClient            *personalClient
	Policies                  *policies
	PolicySearch              *policySearch
	RequestCatalogManagement  *requestCatalogManagement
	RequestCatalogSearch      *requestCatalogSearch
	Roles                     *roles
	Task                      *task
	TaskActions               *taskActions
	TaskSearch                *taskSearch
	User                      *user
	UserSearch                *userSearch
	// contains filtered or unexported fields
}

ConductoroneAPI - ConductorOne API: The ConductorOne API is a HTTP API for managing ConductorOne resources.

func New

func New(opts ...SDKOption) *ConductoroneAPI

New creates a new instance of the SDK with the provided options

func NewWithCredentials added in v1.6.1

func NewWithCredentials(ctx context.Context, cred *ClientCredentials, opts ...CustomSDKOption) (*ConductoroneAPI, error)

type CustomOptions added in v1.6.1

type CustomOptions struct {
	ServerURL string
	Tenant    string
	// contains filtered or unexported fields
}

type CustomSDKOption added in v1.6.1

type CustomSDKOption func(*CustomOptions)

func WithLog added in v1.6.1

func WithLog(logger *zap.Logger) CustomSDKOption

func WithTLSConfig added in v1.6.1

func WithTLSConfig(tlsConfig *tls.Config) CustomSDKOption

func WithTenantCustom added in v1.6.1

func WithTenantCustom(input string) (CustomSDKOption, error)

func WithUserAgent added in v1.6.1

func WithUserAgent(userAgent string) CustomSDKOption

type DeviceCodeResponse added in v1.1.1

type DeviceCodeResponse struct {
	DeviceCode      string `json:"device_code"`
	UserCode        string `json:"user_code"`
	VerificationURI string `json:"verification_uri_complete"`
	ExpiresIn       int64  `json:"expires_in"`
	Interval        int64  `json:"interval"`
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for suplying the SDK with a custom HTTP client

type SDKOption

type SDKOption func(*ConductoroneAPI)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithSecurity added in v1.7.0

func WithSecurity(security shared.Security) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithServerIndex

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTenant added in v1.1.1

func WithTenant(input string) (SDKOption, error)

func WithTenantDomain

func WithTenantDomain(tenantDomain string) SDKOption

WithTenantDomain allows setting the $name variable for url substitution

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL