Categorygithub.com/mach-composer/mcc-sdk-go
module
0.2.0
Repository: https://github.com/mach-composer/mcc-sdk-go.git
Documentation: pkg.go.dev

# README

Go API client for mccsdk

Introduction

MACH composer Cloud is a platform and API to facilitate and coordinate work across teams that build composable architectures using MACH technology.

All operations available in MACH composer cloud are available through this API. For more information about using it in your MACH architecture, have a look at the documentation website.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.1.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://docs.machcomposer.io/

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import mccsdk "github.com/GIT_USER_ID/GIT_REPO_ID"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value mccsdk.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), mccsdk.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value mccsdk.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), mccsdk.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using mccsdk.ContextOperationServerIndices and mccsdk.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), mccsdk.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), mccsdk.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.mach.cloud

ClassMethodHTTP requestDescription
APIClientsApiApiClientCreatePost /organizations/{organization}/projects/{project}/api-clientsCreate new API Client
APIClientsApiApiClientDeleteDelete /organizations/{organization}/projects/{project}/api-clients/{id}Delete API Client
APIClientsApiApiClientGetGet /organizations/{organization}/projects/{project}/api-clients/{id}Get API Client details
APIClientsApiApiClientPatchPatch /organizations/{organization}/projects/{project}/api-clients/{id}Update API Client
APIClientsApiApiClientQueryGet /organizations/{organization}/projects/{project}/api-clientsList all API Clients
APIClientsApiApiClientUpdatePut /organizations/{organization}/projects/{project}/api-clients/{id}Update API Client
ComponentsApiComponentCommitQueryGet /organizations/{organization}/projects/{project}/components/{component}/commitsList all commits of a component between two versions ordered by creation date. If `to` is not provided, it will list all commits from `from` to the latest version.
ComponentsApiComponentCreatePost /organizations/{organization}/projects/{project}/componentsCreate component
ComponentsApiComponentDeleteDelete /organizations/{organization}/projects/{project}/components/{component}Delete a component
ComponentsApiComponentGetGet /organizations/{organization}/projects/{project}/components/{component}Get component details
ComponentsApiComponentLatestVersionGet /organizations/{organization}/projects/{project}/components/{component}/latestGet last component version
ComponentsApiComponentPatchPatch /organizations/{organization}/projects/{project}/components/{component}Patch an existing component
ComponentsApiComponentQueryGet /organizations/{organization}/projects/{project}/componentsList all components
ComponentsApiComponentUpdatePut /organizations/{organization}/projects/{project}/components/{component}Update a component
ComponentsApiComponentVersionCreatePost /organizations/{organization}/projects/{project}/components/{component}/versionsCreate component version
ComponentsApiComponentVersionDeleteDelete /organizations/{organization}/projects/{project}/components/{component}/versions/{version}Delete component version
ComponentsApiComponentVersionDeleteCommitDelete /organizations/{organization}/projects/{project}/components/{component}/versions/{version}/commits/{commit}Delete commit
ComponentsApiComponentVersionGetGet /organizations/{organization}/projects/{project}/components/{component}/versions/{version}Get component version
ComponentsApiComponentVersionGetCommitGet /organizations/{organization}/projects/{project}/components/{component}/versions/{version}/commits/{commit}Get commit details
ComponentsApiComponentVersionPatchPatch /organizations/{organization}/projects/{project}/components/{component}/versions/{version}Patch component version
ComponentsApiComponentVersionPatchCommitPatch /organizations/{organization}/projects/{project}/components/{component}/versions/{version}/commits/{commit}Patch commit
ComponentsApiComponentVersionPushCommitsPost /organizations/{organization}/projects/{project}/components/{component}/versions/{version}/commitsPush commits for this component version
ComponentsApiComponentVersionQueryGet /organizations/{organization}/projects/{project}/components/{component}/versionsList all versions of a component
ComponentsApiComponentVersionQueryCommitsGet /organizations/{organization}/projects/{project}/components/{component}/versions/{version}/commitsGet commits for this component version
ComponentsApiComponentVersionUpdatePut /organizations/{organization}/projects/{project}/components/{component}/versions/{version}Update component version
ComponentsApiComponentVersionUpdateCommitPut /organizations/{organization}/projects/{project}/components/{component}/versions/{version}/commits/{commit}Update commit
MyAccountApiMyAccountInformationGet /account/meGet user information
MyAccountApiUserCreatePost /account/meCreate new user
MyAccountApiUserDeleteDelete /account/me/{id}Delete user
MyAccountApiUserGetGet /account/me/{id}Get user information
MyAccountApiUserPatchPatch /account/me/{id}Update user information
MyAccountApiUserUpdatePut /account/me/{id}Update user information
OrganizationManagementApiOrganizationCreatePost /organizationsCreate new organization
OrganizationManagementApiOrganizationDeleteDelete /organizations/{organization}Delete an organization
OrganizationManagementApiOrganizationGetGet /organizations/{organization}Get organization details
OrganizationManagementApiOrganizationPatchPatch /organizations/{organization}Update an organization
OrganizationManagementApiOrganizationQueryGet /organizationsList all organizations
OrganizationManagementApiOrganizationUpdatePut /organizations/{organization}Update an organization
OrganizationManagementApiOrganizationUserInvitePost /organizations/{organization}/users/inviteInvite a user to the organization
OrganizationManagementApiOrganizationUserInviteDeleteDelete /organizations/{organization}/users/invite/{id}Cancel an invite
OrganizationManagementApiOrganizationUserInvitePatchPatch /organizations/{organization}/users/invite/{id}Accept or reject an invite
OrganizationManagementApiOrganizationUserInviteUpdatePut /organizations/{organization}/users/invite/{id}Accept or reject an invite
OrganizationManagementApiOrganizationUserInviteViewGet /organizations/{organization}/users/invite/{id}View invite information
OrganizationManagementApiOrganizationUserQueryGet /organizations/{organization}/users/inviteList all users in an organization
OrganizationManagementApiProjectCreatePost /organizations/{organization}/projectsCreate new project in an organization
OrganizationManagementApiProjectDeleteDelete /organizations/{organization}/projects/{project}Delete a project
OrganizationManagementApiProjectGetGet /organizations/{organization}/projects/{project}Get project details
OrganizationManagementApiProjectPatchPatch /organizations/{organization}/projects/{project}Update a project
OrganizationManagementApiProjectQueryGet /organizations/{organization}/projectsList all projects in an organization
OrganizationManagementApiProjectUpdatePut /organizations/{organization}/projects/{project}Update a project

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

cookieAuth

  • Type: API key
  • API key parameter name: sessionid
  • Location:

Note, each API key must be added to a map of map[string]APIKey where the key is: sessionid and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		mccsdk.ContextAPIKeys,
		map[string]mccsdk.APIKey{
			"sessionid": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]

# Packages

No description provided by the author