expensify

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BaseUrl = "https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(partnerUserID string, partnerUserSecret string, httpClient *http.Client) *Client

func (*Client) GetPolicies

func (c *Client) GetPolicies(ctx context.Context) ([]Policy, error)

GetPolicies returns policies that user is an admin of.

func (*Client) GetPolicyEmployees

func (c *Client) GetPolicyEmployees(ctx context.Context, policyId string) ([]User, error)

GetPolicyEmployees returns employees for a signle policy.

type Credentials

type Credentials struct {
	PartnerUserID     string `json:"partnerUserID"`
	PartnerUserSecret string `json:"partnerUserSecret"`
}

type Employees

type Employees struct {
	Employees []User `json:"employees"`
}

type Error

type Error struct {
	Message    string `json:"responseMessage"`
	StatusCode int    `json:"responseCode"`
}

type PoliciesInputSettings

type PoliciesInputSettings struct {
	Type      string `json:"type"`
	AdminOnly bool   `json:"adminOnly,omitempty"`
	UserEmail string `json:"userEmail,omitempty"`
}

type PoliciesRequestBody

type PoliciesRequestBody struct {
	Type          string                `json:"type"`
	Credentials   Credentials           `json:"credentials"`
	InputSettings PoliciesInputSettings `json:"inputSettings"`
}

type Policy

type Policy struct {
	OutputCurrency string `json:"outputCurrency"`
	Owner          string `json:"owner"`
	Role           string `json:"role"`
	Name           string `json:"name"`
	ID             string `json:"id"`
	Type           string `json:"type"`
}

type PolicyInputSettings

type PolicyInputSettings struct {
	Type         string   `json:"type"`
	Fields       []string `json:"fields,omitempty"`
	PolicyIDList []string `json:"policyIDList"`
	UserEmail    string   `json:"userEmail,omitempty"`
}

type PolicyListResponse

type PolicyListResponse struct {
	PolicyList   []Policy `json:"policyList"`
	ResponseCode int64    `json:"responseCode"`
}

type PolicyRequestBody

type PolicyRequestBody struct {
	Type          string              `json:"type"`
	Credentials   Credentials         `json:"credentials"`
	InputSettings PolicyInputSettings `json:"inputSettings"`
}

type PolicyResponse

type PolicyResponse struct {
	PolicyInfo   map[string]Employees `json:"policyInfo"`
	ResponseCode int64                `json:"responseCode"`
}

type User

type User struct {
	Role      string `json:"role"`
	Email     string `json:"email"`
	SubmitsTo string `json:"submitsTo"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL