X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fclientapi%2Fpolicy%2Fpolicy_client.go;fp=pkg%2Fclientapi%2Fpolicy%2Fpolicy_client.go;h=b8ca3bb658ab7fcd1fe6b58df6d148e8e4b96d4c;hb=3895a8c8775ef96652e6473414fdd7366c59f404;hp=0000000000000000000000000000000000000000;hpb=5120ec103eead26427b977f4b2456c2ce57b36ac;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/clientapi/policy/policy_client.go b/pkg/clientapi/policy/policy_client.go new file mode 100644 index 0000000..b8ca3bb --- /dev/null +++ b/pkg/clientapi/policy/policy_client.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package policy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new policy API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for policy API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +SubscribePolicy subscribes and send p o l i c y message to r a n to execute a specific p o l i c y during call processing in r a n after each occurrence of a defined s u b s c r IP t i o n +*/ +func (a *Client) SubscribePolicy(params *SubscribePolicyParams) (*SubscribePolicyCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSubscribePolicyParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "subscribePolicy", + Method: "POST", + PathPattern: "/subscriptions/policy", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SubscribePolicyReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SubscribePolicyCreated), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +}