Skip to content

AryeoHQ/aryeo-api-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aryeo SDK

Introduction

This is an auto-generated client SDK for interfacing with the Aryeo API. We support a variety of languages and frameworks that are a great starting point for experimenting with the API. If there is an additional language or framework that you want to see supported, then please reach out and make a contribution!

Dart Go Node JS PHP Ruby Rust Swift

Authentication

To start using the Aryeo API, you will need to generate an API key from your group's developer settings. Then, make sure to provide your API key as a bearer token. Requests made without an API key will result in a 401 Unauthorized error.

Example: Authorization: Bearer {API_KEY}

Installation

Add the following block to go.mod:

require (
	github.com/AryeoHQ/aryeo-api-go-sdk
)

Getting Started

package main

import (
    "context"
    "fmt"
    "os"
    aryeo "github.com/AryeoHQ/aryeo-api-go-sdk"
)

func main() {
    uuid := "UUID"

    configuration := aryeo.NewConfiguration()
    api_client := aryeo.NewAPIClient(configuration)
    auth := context.WithValue(context.Background(), aryeo.ContextAccessToken, "API_KEY")
    resp, r, err := api_client.ListingsApi.GetListingsId(auth, uuid).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ListingsApi.GetListingsId``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    
    fmt.Fprintf(os.Stdout, "%v\n", resp.Data.Address.FormattedAddress1)
}

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 sw.ContextServerIndex of type int.

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

Templated Server URL

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

ctx := context.WithValue(context.Background(), sw.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 identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

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

Documentation for API Endpoints

All URIs are relative to https://api.aryeo.com/v1

Class Method HTTP request Description
AppointmentsApi GetAppointments Get /appointments List all appointments.
AppointmentsApi GetAvailableDates Get /scheduling/available-dates Fetch available days for a user or group
AppointmentsApi GetAvailableTimeslots Get /scheduling/available-timeslots Fetch available timeslots for a user or group
AppointmentsApi GetUnconfirmedAppointments Get /unconfirmed-appointments List all unconfirmed appointments.
AppointmentsApi GetUnconfirmedAppointmentsId Get /unconfirmed-appointments/{unconfirmed_appointment_id} Retrieve an unconfirmed appointment.
AppointmentsApi PutAppointmentsAppointmentIdCancel Put /appointments/{appointment_id}/cancel Cancel an appointment.
AppointmentsApi PutAppointmentsAppointmentIdReschedule Put /appointments/{appointment_id}/reschedule Reschedule an appointment.
ListingsApi GetListings Get /listings List all listings.
ListingsApi GetListingsId Get /listings/{listing_id} Retrieve a listing.
OrdersApi GetOrders Get /orders List all orders.
OrdersApi GetOrdersId Get /orders/{order_id} Retrieve an order.
OrdersApi GetProducts Get /products List all products.
OrdersApi PostOrders Post /orders Create an order.
VendorsApi GetVendors Get /vendors List all vendors.
VendorsApi GetVendorsId Get /vendors/{vendor_id} Retrieve a vendor.

Documentation For Models

Documentation For Authorization

Token

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING")
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

jarrod@aryeo.com