Documentation

Overview

    Package payee implements payee entities and services

    Index

    Examples

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Location

    type Location struct {
    	ID      string `json:"id"`
    	PayeeID string `json:"payee_id"`
    	// Deleted Deleted payees will only be included in delta requests
    	Deleted bool `json:"deleted"`
    
    	Latitude  *float64 `json:"latitude,string"`
    	Longitude *float64 `json:"longitude,string"`
    }

      Location represents a location for a payee When a transaction is saved with an specified payee on the YNAB mobile apps, the GPS coordinates for that location are stored, so that the next time the user is in the same place (like the Grocery store) YNAB can pre-populate nearby payees for you. Locations will not be available for all payees.

      type Payee

      type Payee struct {
      	ID   string `json:"id"`
      	Name string `json:"name"`
      	// Deleted Deleted payees will only be included in delta requests
      	Deleted bool `json:"deleted"`
      
      	// TransferAccountID If a transfer payee, the account_id to which this
      	// payee transfers to
      	TransferAccountID *string `json:"transfer_account_id"`
      }

        Payee represents a payee for a budget

        type Service

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

          Service wraps YNAB payee API endpoints

          func NewService

          func NewService(c api.ClientReader) *Service

            NewService facilitates the creation of a new payee service instance

            func (*Service) GetPayee

            func (s *Service) GetPayee(budgetID, payeeID string) (*Payee, error)

              GetPayee fetches a specific payee from a budget https://api.youneedabudget.com/v1#/Payees/getPayeeById

              Example
              Output:
              
              *payee.Payee
              

              func (*Service) GetPayeeLocation

              func (s *Service) GetPayeeLocation(budgetID, payeeLocationID string) (*Location, error)

                GetPayeeLocation fetches a specific payee location from a budget https://api.youneedabudget.com/v1#/Payee_Locations/getPayeeLocationById

                Example
                Output:
                
                *payee.Location
                

                func (*Service) GetPayeeLocations

                func (s *Service) GetPayeeLocations(budgetID string) ([]*Location, error)

                  GetPayeeLocations fetches the list of payee locations from a budget https://api.youneedabudget.com/v1#/Payee_Locations/getPayeeLocations

                  Example
                  Output:
                  
                  []*payee.Location
                  

                  func (*Service) GetPayeeLocationsByPayee

                  func (s *Service) GetPayeeLocationsByPayee(budgetID, payeeID string) ([]*Location, error)

                    GetPayeeLocationsByPayee fetches the list of locations of a specific payee from a budget https://api.youneedabudget.com/v1#/Payee_Locations/getPayeeLocationsByPayee

                    Example
                    Output:
                    
                    []*payee.Location
                    

                    func (*Service) GetPayees

                    func (s *Service) GetPayees(budgetID string) ([]*Payee, error)

                      GetPayees fetches the list of payees from a budget https://api.youneedabudget.com/v1#/Payees/getPayees

                      Example
                      Output:
                      
                      []*payee.Payee