Skip to content

Latest commit

 

History

History
405 lines (268 loc) · 12.6 KB

File metadata and controls

405 lines (268 loc) · 12.6 KB

\SuppliersAPI

All URIs are relative to https://api-v2.fattureincloud.it

Method HTTP request Description
CreateSupplier Post /c/{company_id}/entities/suppliers Create Supplier
DeleteSupplier Delete /c/{company_id}/entities/suppliers/{supplier_id} Delete Supplier
GetSupplier Get /c/{company_id}/entities/suppliers/{supplier_id} Get Supplier
ListSuppliers Get /c/{company_id}/entities/suppliers List Suppliers
ModifySupplier Put /c/{company_id}/entities/suppliers/{supplier_id} Modify Supplier

CreateSupplier

CreateSupplierResponse CreateSupplier(ctx, companyId).CreateSupplierRequest(createSupplierRequest).Execute()

Create Supplier

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	createSupplierRequest := *fattureincloud.NewCreateSupplierRequest() // CreateSupplierRequest | The supplier to create (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.SuppliersAPI.CreateSupplier(auth, companyId).CreateSupplierRequest(createSupplierRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SuppliersAPI.CreateSupplier``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateSupplier`: CreateSupplierResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.

Other Parameters

Other parameters are passed through a pointer to a apiCreateSupplierRequest struct via the builder pattern

Name Type Description Notes

createSupplierRequest | CreateSupplierRequest | The supplier to create |

Return type

CreateSupplierResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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

DeleteSupplier

DeleteSupplier(ctx, companyId, supplierId).Execute()

Delete Supplier

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	supplierId := int32(56) // int32 | The ID of the supplier.

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.SuppliersAPI.DeleteSupplier(auth, companyId, supplierId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SuppliersAPI.DeleteSupplier``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.
supplierId int32 The ID of the supplier.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteSupplierRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

GetSupplier

GetSupplierResponse GetSupplier(ctx, companyId, supplierId).Fields(fields).Fieldset(fieldset).Execute()

Get Supplier

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	supplierId := int32(56) // int32 | The ID of the supplier.
	fields := "fields_example" // string | List of comma-separated fields. (optional)
	fieldset := "fieldset_example" // string | Name of the fieldset. (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.SuppliersAPI.GetSupplier(auth, companyId, supplierId).Fields(fields).Fieldset(fieldset).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SuppliersAPI.GetSupplier``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSupplier`: GetSupplierResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.
supplierId int32 The ID of the supplier.

Other Parameters

Other parameters are passed through a pointer to a apiGetSupplierRequest struct via the builder pattern

Name Type Description Notes

fields | string | List of comma-separated fields. | fieldset | string | Name of the fieldset. |

Return type

GetSupplierResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

ListSuppliers

ListSuppliersResponse ListSuppliers(ctx, companyId).Fields(fields).Fieldset(fieldset).Sort(sort).Page(page).PerPage(perPage).Q(q).Execute()

List Suppliers

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	fields := "fields_example" // string | List of comma-separated fields. (optional)
	fieldset := "fieldset_example" // string | Name of the fieldset. (optional)
	sort := "sort_example" // string | List of comma-separated fields for result sorting (minus for desc sorting). (optional)
	page := int32(56) // int32 | The page to retrieve. (optional) (default to 1)
	perPage := int32(56) // int32 | The size of the page. (optional) (default to 5)
	q := "q_example" // string | Query for filtering the results. (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.SuppliersAPI.ListSuppliers(auth, companyId).Fields(fields).Fieldset(fieldset).Sort(sort).Page(page).PerPage(perPage).Q(q).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SuppliersAPI.ListSuppliers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListSuppliers`: ListSuppliersResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.

Other Parameters

Other parameters are passed through a pointer to a apiListSuppliersRequest struct via the builder pattern

Name Type Description Notes

fields | string | List of comma-separated fields. | fieldset | string | Name of the fieldset. | sort | string | List of comma-separated fields for result sorting (minus for desc sorting). | page | int32 | The page to retrieve. | [default to 1] perPage | int32 | The size of the page. | [default to 5] q | string | Query for filtering the results. |

Return type

ListSuppliersResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

ModifySupplier

ModifySupplierResponse ModifySupplier(ctx, companyId, supplierId).ModifySupplierRequest(modifySupplierRequest).Execute()

Modify Supplier

Example

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"
	fattureincloudapi "github.com/fattureincloud/fattureincloud-go-sdk/v2/api"
	fattureincloud "github.com/fattureincloud/fattureincloud-go-sdk/v2/model"
)

func main() {
	companyId := int32(12345) // int32 | The ID of the company.
	supplierId := int32(56) // int32 | The ID of the supplier.
	modifySupplierRequest := *fattureincloud.NewModifySupplierRequest() // ModifySupplierRequest | The modified Supplier. First level parameters are managed in delta mode. (optional)

	auth := context.WithValue(context.Background(), fattureincloudapi.ContextAccessToken, "ACCESS_TOKEN")
	configuration := fattureincloudapi.NewConfiguration()
	apiClient := fattureincloudapi.NewAPIClient(configuration)
	resp, r, err := apiClient.SuppliersAPI.ModifySupplier(auth, companyId, supplierId).ModifySupplierRequest(modifySupplierRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SuppliersAPI.ModifySupplier``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ModifySupplier`: ModifySupplierResponse
	json.NewEncoder(os.Stdout).Encode(resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
companyId int32 The ID of the company.
supplierId int32 The ID of the supplier.

Other Parameters

Other parameters are passed through a pointer to a apiModifySupplierRequest struct via the builder pattern

Name Type Description Notes

modifySupplierRequest | ModifySupplierRequest | The modified Supplier. First level parameters are managed in delta mode. |

Return type

ModifySupplierResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

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