Commit 94e31f52 authored by Simon Pastor's avatar Simon Pastor
Browse files

clients

parent edd5ce86
Loading
Loading
Loading
Loading
+84 −0
Original line number Diff line number Diff line
# Go API client for client

The ETSI MEC ISG MEC011 MEC Application Support API described using OpenAPI

## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project.  By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client.

- API version: 2.1.1
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen

## Installation
Put the package under your project folder and add the following in import:
```golang
import "./client"
```

## Documentation for API Endpoints

All URIs are relative to *https://localhost/sandboxname/mec_app_support/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AppConfirmReadyApi* | [**ApplicationsConfirmReadyPOST**](docs/AppConfirmReadyApi.md#applicationsconfirmreadypost) | **Post** /applications/{appInstanceId}/confirm_ready | 
*AppConfirmTerminationApi* | [**ApplicationsConfirmTerminationPOST**](docs/AppConfirmTerminationApi.md#applicationsconfirmterminationpost) | **Post** /applications/{appInstanceId}/confirm_termination | 
*AppDnsRulesApi* | [**ApplicationsDnsRuleGET**](docs/AppDnsRulesApi.md#applicationsdnsruleget) | **Get** /applications/{appInstanceId}/dns_rules/{dnsRuleId} | 
*AppDnsRulesApi* | [**ApplicationsDnsRulePUT**](docs/AppDnsRulesApi.md#applicationsdnsruleput) | **Put** /applications/{appInstanceId}/dns_rules/{dnsRuleId} | 
*AppDnsRulesApi* | [**ApplicationsDnsRulesGET**](docs/AppDnsRulesApi.md#applicationsdnsrulesget) | **Get** /applications/{appInstanceId}/dns_rules | 
*AppSubscriptionsApi* | [**ApplicationsSubscriptionDELETE**](docs/AppSubscriptionsApi.md#applicationssubscriptiondelete) | **Delete** /applications/{appInstanceId}/subscriptions/{subscriptionId} | 
*AppSubscriptionsApi* | [**ApplicationsSubscriptionGET**](docs/AppSubscriptionsApi.md#applicationssubscriptionget) | **Get** /applications/{appInstanceId}/subscriptions/{subscriptionId} | 
*AppSubscriptionsApi* | [**ApplicationsSubscriptionsGET**](docs/AppSubscriptionsApi.md#applicationssubscriptionsget) | **Get** /applications/{appInstanceId}/subscriptions | 
*AppSubscriptionsApi* | [**ApplicationsSubscriptionsPOST**](docs/AppSubscriptionsApi.md#applicationssubscriptionspost) | **Post** /applications/{appInstanceId}/subscriptions | 
*AppTrafficRulesApi* | [**ApplicationsTrafficRuleGET**](docs/AppTrafficRulesApi.md#applicationstrafficruleget) | **Get** /applications/{appInstanceId}/traffic_rules/{trafficRuleId} | 
*AppTrafficRulesApi* | [**ApplicationsTrafficRulePUT**](docs/AppTrafficRulesApi.md#applicationstrafficruleput) | **Put** /applications/{appInstanceId}/traffic_rules/{trafficRuleId} | 
*AppTrafficRulesApi* | [**ApplicationsTrafficRulesGET**](docs/AppTrafficRulesApi.md#applicationstrafficrulesget) | **Get** /applications/{appInstanceId}/traffic_rules | 
*TimingApi* | [**TimingCapsGET**](docs/TimingApi.md#timingcapsget) | **Get** /timing/timing_caps | 
*TimingApi* | [**TimingCurrentTimeGET**](docs/TimingApi.md#timingcurrenttimeget) | **Get** /timing/current_time | 


## Documentation For Models

 - [AppReadyConfirmation](docs/AppReadyConfirmation.md)
 - [AppTerminationConfirmation](docs/AppTerminationConfirmation.md)
 - [AppTerminationNotification](docs/AppTerminationNotification.md)
 - [AppTerminationNotificationLinks](docs/AppTerminationNotificationLinks.md)
 - [AppTerminationNotificationSubscription](docs/AppTerminationNotificationSubscription.md)
 - [CurrentTime](docs/CurrentTime.md)
 - [DestinationInterface](docs/DestinationInterface.md)
 - [DestinationInterfaceInterfaceType](docs/DestinationInterfaceInterfaceType.md)
 - [DnsRule](docs/DnsRule.md)
 - [DnsRuleIpAddressType](docs/DnsRuleIpAddressType.md)
 - [DnsRuleState](docs/DnsRuleState.md)
 - [LinkType](docs/LinkType.md)
 - [LinkTypeConfirmTermination](docs/LinkTypeConfirmTermination.md)
 - [MecAppSuptApiSubscriptionLinkList](docs/MecAppSuptApiSubscriptionLinkList.md)
 - [MecAppSuptApiSubscriptionLinkListLinks](docs/MecAppSuptApiSubscriptionLinkListLinks.md)
 - [MecAppSuptApiSubscriptionLinkListSubscription](docs/MecAppSuptApiSubscriptionLinkListSubscription.md)
 - [OperationActionType](docs/OperationActionType.md)
 - [ProblemDetails](docs/ProblemDetails.md)
 - [ReadyIndicationType](docs/ReadyIndicationType.md)
 - [Self](docs/Self.md)
 - [TimingCaps](docs/TimingCaps.md)
 - [TimingCapsNtpServers](docs/TimingCapsNtpServers.md)
 - [TimingCapsNtpServersAuthenticationOption](docs/TimingCapsNtpServersAuthenticationOption.md)
 - [TimingCapsNtpServersNtpServerAddrType](docs/TimingCapsNtpServersNtpServerAddrType.md)
 - [TimingCapsPtpMasters](docs/TimingCapsPtpMasters.md)
 - [TimingCapsTimeStamp](docs/TimingCapsTimeStamp.md)
 - [TrafficFilter](docs/TrafficFilter.md)
 - [TrafficRule](docs/TrafficRule.md)
 - [TrafficRuleAction](docs/TrafficRuleAction.md)
 - [TrafficRuleFilterType](docs/TrafficRuleFilterType.md)
 - [TrafficRuleState](docs/TrafficRuleState.md)
 - [TunnelInfo](docs/TunnelInfo.md)
 - [TunnelInfoTunnelType](docs/TunnelInfoTunnelType.md)


## Documentation For Authorization
 Endpoints do not require authorization.


## Author

cti_support@etsi.org
+2142 −0

File added.

Preview size limit exceeded, changes collapsed.

+181 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the \"License\");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an \"AS IS\" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE MEC Application Support API
 *
 * The ETSI MEC ISG MEC011 MEC Application Support API described using OpenAPI
 *
 * API version: 2.1.1
 * Contact: cti_support@etsi.org
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package client

import (
	"context"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"strings"
)

// Linger please
var (
	_ context.Context
)

type AppConfirmReadyApiService service

/*
AppConfirmReadyApiService
This method may be used by the MEC application instance to notify the MEC platform that it is up and running.
 * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 * @param appInstanceId Represents a MEC application instance. Note that the appInstanceId is allocated by the MEC platform manager.
 * @param optional nil or *ApplicationsConfirmReadyPOSTOpts - Optional Parameters:
     * @param "Body" (optional.Interface of AppReadyConfirmation) -


*/

type ApplicationsConfirmReadyPOSTOpts struct {
	Body optional.Interface
}

func (a *AppConfirmReadyApiService) ApplicationsConfirmReadyPOST(ctx context.Context, appInstanceId string, localVarOptionals *ApplicationsConfirmReadyPOSTOpts) (*http.Response, error) {
	var (
		localVarHttpMethod = strings.ToUpper("Post")
		localVarPostBody   interface{}
		localVarFileName   string
		localVarFileBytes  []byte
	)

	// create path and map variables
	localVarPath := a.client.cfg.BasePath + "/applications/{appInstanceId}/confirm_ready"
	localVarPath = strings.Replace(localVarPath, "{"+"appInstanceId"+"}", fmt.Sprintf("%v", appInstanceId), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	// to determine the Content-Type header
	localVarHttpContentTypes := []string{"application/json"}

	// set Content-Type header
	localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
	if localVarHttpContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHttpContentType
	}

	// to determine the Accept header
	localVarHttpHeaderAccepts := []string{"application/problem+json", "text/plain"}

	// set Accept header
	localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
	if localVarHttpHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
	}
	// body params
	if localVarOptionals != nil && localVarOptionals.Body.IsSet() {

		localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(AppReadyConfirmation)
		if !localVarOptionalBodyok {
			return nil, reportError("body should be AppReadyConfirmation")
		}
		localVarPostBody = &localVarOptionalBody
	}
	r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
	if err != nil {
		return nil, err
	}

	localVarHttpResponse, err := a.client.callAPI(r)
	if err != nil || localVarHttpResponse == nil {
		return localVarHttpResponse, err
	}

	localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
	localVarHttpResponse.Body.Close()
	if err != nil {
		return localVarHttpResponse, err
	}

	if localVarHttpResponse.StatusCode >= 300 {
		newErr := GenericSwaggerError{
			body:  localVarBody,
			error: localVarHttpResponse.Status,
		}

		if localVarHttpResponse.StatusCode == 401 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 403 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 404 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 409 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 429 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		return localVarHttpResponse, newErr
	}

	return localVarHttpResponse, nil
}
+181 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the \"License\");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an \"AS IS\" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE MEC Application Support API
 *
 * The ETSI MEC ISG MEC011 MEC Application Support API described using OpenAPI
 *
 * API version: 2.1.1
 * Contact: cti_support@etsi.org
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package client

import (
	"context"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"strings"
)

// Linger please
var (
	_ context.Context
)

type AppConfirmTerminationApiService service

/*
AppConfirmTerminationApiService
This method is used to confirm the application level termination  of an application instance.
 * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
 * @param appInstanceId Represents a MEC application instance. Note that the appInstanceId is allocated by the MEC platform manager.
 * @param optional nil or *ApplicationsConfirmTerminationPOSTOpts - Optional Parameters:
     * @param "Body" (optional.Interface of AppTerminationConfirmation) -


*/

type ApplicationsConfirmTerminationPOSTOpts struct {
	Body optional.Interface
}

func (a *AppConfirmTerminationApiService) ApplicationsConfirmTerminationPOST(ctx context.Context, appInstanceId string, localVarOptionals *ApplicationsConfirmTerminationPOSTOpts) (*http.Response, error) {
	var (
		localVarHttpMethod = strings.ToUpper("Post")
		localVarPostBody   interface{}
		localVarFileName   string
		localVarFileBytes  []byte
	)

	// create path and map variables
	localVarPath := a.client.cfg.BasePath + "/applications/{appInstanceId}/confirm_termination"
	localVarPath = strings.Replace(localVarPath, "{"+"appInstanceId"+"}", fmt.Sprintf("%v", appInstanceId), -1)

	localVarHeaderParams := make(map[string]string)
	localVarQueryParams := url.Values{}
	localVarFormParams := url.Values{}

	// to determine the Content-Type header
	localVarHttpContentTypes := []string{"application/json"}

	// set Content-Type header
	localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
	if localVarHttpContentType != "" {
		localVarHeaderParams["Content-Type"] = localVarHttpContentType
	}

	// to determine the Accept header
	localVarHttpHeaderAccepts := []string{"application/problem+json", "text/plain"}

	// set Accept header
	localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
	if localVarHttpHeaderAccept != "" {
		localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
	}
	// body params
	if localVarOptionals != nil && localVarOptionals.Body.IsSet() {

		localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(AppTerminationConfirmation)
		if !localVarOptionalBodyok {
			return nil, reportError("body should be AppTerminationConfirmation")
		}
		localVarPostBody = &localVarOptionalBody
	}
	r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
	if err != nil {
		return nil, err
	}

	localVarHttpResponse, err := a.client.callAPI(r)
	if err != nil || localVarHttpResponse == nil {
		return localVarHttpResponse, err
	}

	localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
	localVarHttpResponse.Body.Close()
	if err != nil {
		return localVarHttpResponse, err
	}

	if localVarHttpResponse.StatusCode >= 300 {
		newErr := GenericSwaggerError{
			body:  localVarBody,
			error: localVarHttpResponse.Status,
		}

		if localVarHttpResponse.StatusCode == 401 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 403 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 404 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 409 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		if localVarHttpResponse.StatusCode == 429 {
			var v ProblemDetails
			err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
			if err != nil {
				newErr.error = err.Error()
				return localVarHttpResponse, newErr
			}
			newErr.model = v
			return localVarHttpResponse, newErr
		}

		return localVarHttpResponse, newErr
	}

	return localVarHttpResponse, nil
}
+425 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading