square

package
v3.83.7 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	PermissionStrings = map[Permission]string{
		BankAccountsRead:                  "bank_accounts_read",
		AppointmentsWrite:                 "appointments_write",
		AppointmentsAllWrite:              "appointments_all_write",
		AppointmentsRead:                  "appointments_read",
		AppointmentsAllRead:               "appointments_all_read",
		AppointmentsBusinessSettingsRead:  "appointments_business_settings_read",
		PaymentsRead:                      "payments_read",
		PaymentsWrite:                     "payments_write",
		CashDrawerRead:                    "cash_drawer_read",
		ItemsWrite:                        "items_write",
		ItemsRead:                         "items_read",
		OrdersWrite:                       "orders_write",
		OrdersRead:                        "orders_read",
		CustomersWrite:                    "customers_write",
		CustomersRead:                     "customers_read",
		DeviceCredentialManagement:        "device_credential_management",
		DevicesRead:                       "devices_read",
		DisputesWrite:                     "disputes_write",
		DisputesRead:                      "disputes_read",
		EmployeesRead:                     "employees_read",
		GiftcardsRead:                     "giftcards_read",
		GiftcardsWrite:                    "giftcards_write",
		InventoryWrite:                    "inventory_write",
		InventoryRead:                     "inventory_read",
		InvoicesWrite:                     "invoices_write",
		InvoicesRead:                      "invoices_read",
		TimecardsSettingsWrite:            "timecards_settings_write",
		TimecardsWrite:                    "timecards_write",
		TimecardsSettingsRead:             "timecards_settings_read",
		TimecardsRead:                     "timecards_read",
		MerchantProfileWrite:              "merchant_profile_write",
		MerchantProfileRead:               "merchant_profile_read",
		LoyaltyRead:                       "loyalty_read",
		LoyaltyWrite:                      "loyalty_write",
		PaymentsWriteInPerson:             "payments_write_in_person",
		PaymentsWriteSharedOnfile:         "payments_write_shared_onfile",
		PaymentsWriteAdditionalRecipients: "payments_write_additional_recipients",
		PayoutsRead:                       "payouts_read",
		OnlineStoreSiteRead:               "online_store_site_read",
		OnlineStoreSnippetsWrite:          "online_store_snippets_write",
		OnlineStoreSnippetsRead:           "online_store_snippets_read",
		SubscriptionsWrite:                "subscriptions_write",
		SubscriptionsRead:                 "subscriptions_read",
	}

	StringToPermission = map[string]Permission{
		"bank_accounts_read":                   BankAccountsRead,
		"appointments_write":                   AppointmentsWrite,
		"appointments_all_write":               AppointmentsAllWrite,
		"appointments_read":                    AppointmentsRead,
		"appointments_all_read":                AppointmentsAllRead,
		"appointments_business_settings_read":  AppointmentsBusinessSettingsRead,
		"payments_read":                        PaymentsRead,
		"payments_write":                       PaymentsWrite,
		"cash_drawer_read":                     CashDrawerRead,
		"items_write":                          ItemsWrite,
		"items_read":                           ItemsRead,
		"orders_write":                         OrdersWrite,
		"orders_read":                          OrdersRead,
		"customers_write":                      CustomersWrite,
		"customers_read":                       CustomersRead,
		"device_credential_management":         DeviceCredentialManagement,
		"devices_read":                         DevicesRead,
		"disputes_write":                       DisputesWrite,
		"disputes_read":                        DisputesRead,
		"employees_read":                       EmployeesRead,
		"giftcards_read":                       GiftcardsRead,
		"giftcards_write":                      GiftcardsWrite,
		"inventory_write":                      InventoryWrite,
		"inventory_read":                       InventoryRead,
		"invoices_write":                       InvoicesWrite,
		"invoices_read":                        InvoicesRead,
		"timecards_settings_write":             TimecardsSettingsWrite,
		"timecards_write":                      TimecardsWrite,
		"timecards_settings_read":              TimecardsSettingsRead,
		"timecards_read":                       TimecardsRead,
		"merchant_profile_write":               MerchantProfileWrite,
		"merchant_profile_read":                MerchantProfileRead,
		"loyalty_read":                         LoyaltyRead,
		"loyalty_write":                        LoyaltyWrite,
		"payments_write_in_person":             PaymentsWriteInPerson,
		"payments_write_shared_onfile":         PaymentsWriteSharedOnfile,
		"payments_write_additional_recipients": PaymentsWriteAdditionalRecipients,
		"payouts_read":                         PayoutsRead,
		"online_store_site_read":               OnlineStoreSiteRead,
		"online_store_snippets_write":          OnlineStoreSnippetsWrite,
		"online_store_snippets_read":           OnlineStoreSnippetsRead,
		"subscriptions_write":                  SubscriptionsWrite,
		"subscriptions_read":                   SubscriptionsRead,
	}

	PermissionIDs = map[Permission]int{
		BankAccountsRead:                  1,
		AppointmentsWrite:                 2,
		AppointmentsAllWrite:              3,
		AppointmentsRead:                  4,
		AppointmentsAllRead:               5,
		AppointmentsBusinessSettingsRead:  6,
		PaymentsRead:                      7,
		PaymentsWrite:                     8,
		CashDrawerRead:                    9,
		ItemsWrite:                        10,
		ItemsRead:                         11,
		OrdersWrite:                       12,
		OrdersRead:                        13,
		CustomersWrite:                    14,
		CustomersRead:                     15,
		DeviceCredentialManagement:        16,
		DevicesRead:                       17,
		DisputesWrite:                     18,
		DisputesRead:                      19,
		EmployeesRead:                     20,
		GiftcardsRead:                     21,
		GiftcardsWrite:                    22,
		InventoryWrite:                    23,
		InventoryRead:                     24,
		InvoicesWrite:                     25,
		InvoicesRead:                      26,
		TimecardsSettingsWrite:            27,
		TimecardsWrite:                    28,
		TimecardsSettingsRead:             29,
		TimecardsRead:                     30,
		MerchantProfileWrite:              31,
		MerchantProfileRead:               32,
		LoyaltyRead:                       33,
		LoyaltyWrite:                      34,
		PaymentsWriteInPerson:             35,
		PaymentsWriteSharedOnfile:         36,
		PaymentsWriteAdditionalRecipients: 37,
		PayoutsRead:                       38,
		OnlineStoreSiteRead:               39,
		OnlineStoreSnippetsWrite:          40,
		OnlineStoreSnippetsRead:           41,
		SubscriptionsWrite:                42,
		SubscriptionsRead:                 43,
	}

	IdToPermission = map[int]Permission{
		1:  BankAccountsRead,
		2:  AppointmentsWrite,
		3:  AppointmentsAllWrite,
		4:  AppointmentsRead,
		5:  AppointmentsAllRead,
		6:  AppointmentsBusinessSettingsRead,
		7:  PaymentsRead,
		8:  PaymentsWrite,
		9:  CashDrawerRead,
		10: ItemsWrite,
		11: ItemsRead,
		12: OrdersWrite,
		13: OrdersRead,
		14: CustomersWrite,
		15: CustomersRead,
		16: DeviceCredentialManagement,
		17: DevicesRead,
		18: DisputesWrite,
		19: DisputesRead,
		20: EmployeesRead,
		21: GiftcardsRead,
		22: GiftcardsWrite,
		23: InventoryWrite,
		24: InventoryRead,
		25: InvoicesWrite,
		26: InvoicesRead,
		27: TimecardsSettingsWrite,
		28: TimecardsWrite,
		29: TimecardsSettingsRead,
		30: TimecardsRead,
		31: MerchantProfileWrite,
		32: MerchantProfileRead,
		33: LoyaltyRead,
		34: LoyaltyWrite,
		35: PaymentsWriteInPerson,
		36: PaymentsWriteSharedOnfile,
		37: PaymentsWriteAdditionalRecipients,
		38: PayoutsRead,
		39: OnlineStoreSiteRead,
		40: OnlineStoreSnippetsWrite,
		41: OnlineStoreSnippetsRead,
		42: SubscriptionsWrite,
		43: SubscriptionsRead,
	}
)

Functions

func AnalyzeAndPrintPermissions added in v3.80.5

func AnalyzeAndPrintPermissions(cfg *config.Config, key string)

Types

type Analyzer added in v3.81.1

type Analyzer struct {
	Cfg *config.Config
}

func (Analyzer) Analyze added in v3.81.1

func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error)

func (Analyzer) Type added in v3.81.1

type Permission added in v3.82.3

type Permission int
const (
	Invalid                           Permission = iota
	BankAccountsRead                  Permission = iota
	AppointmentsWrite                 Permission = iota
	AppointmentsAllWrite              Permission = iota
	AppointmentsRead                  Permission = iota
	AppointmentsAllRead               Permission = iota
	AppointmentsBusinessSettingsRead  Permission = iota
	PaymentsRead                      Permission = iota
	PaymentsWrite                     Permission = iota
	CashDrawerRead                    Permission = iota
	ItemsWrite                        Permission = iota
	ItemsRead                         Permission = iota
	OrdersWrite                       Permission = iota
	OrdersRead                        Permission = iota
	CustomersWrite                    Permission = iota
	CustomersRead                     Permission = iota
	DeviceCredentialManagement        Permission = iota
	DevicesRead                       Permission = iota
	DisputesWrite                     Permission = iota
	DisputesRead                      Permission = iota
	EmployeesRead                     Permission = iota
	GiftcardsRead                     Permission = iota
	GiftcardsWrite                    Permission = iota
	InventoryWrite                    Permission = iota
	InventoryRead                     Permission = iota
	InvoicesWrite                     Permission = iota
	InvoicesRead                      Permission = iota
	TimecardsSettingsWrite            Permission = iota
	TimecardsWrite                    Permission = iota
	TimecardsSettingsRead             Permission = iota
	TimecardsRead                     Permission = iota
	MerchantProfileWrite              Permission = iota
	MerchantProfileRead               Permission = iota
	LoyaltyRead                       Permission = iota
	LoyaltyWrite                      Permission = iota
	PaymentsWriteInPerson             Permission = iota
	PaymentsWriteSharedOnfile         Permission = iota
	PaymentsWriteAdditionalRecipients Permission = iota
	PayoutsRead                       Permission = iota
	OnlineStoreSiteRead               Permission = iota
	OnlineStoreSnippetsWrite          Permission = iota
	OnlineStoreSnippetsRead           Permission = iota
	SubscriptionsWrite                Permission = iota
	SubscriptionsRead                 Permission = iota
)

func PermissionFromID added in v3.82.3

func PermissionFromID(id int) (Permission, error)

PermissionFromID converts an ID to its Permission enum

func PermissionFromString added in v3.82.3

func PermissionFromString(s string) (Permission, error)

PermissionFromString converts a string representation to its Permission enum

func (Permission) ToID added in v3.82.3

func (p Permission) ToID() (int, error)

ToID converts a Permission enum to its ID

func (Permission) ToString added in v3.82.3

func (p Permission) ToString() (string, error)

ToString converts a Permission enum to its string representation

type PermissionsJSON

type PermissionsJSON struct {
	Scopes     []string `json:"scopes"`
	ExpiresAt  string   `json:"expires_at"`
	ClientID   string   `json:"client_id"`
	MerchantID string   `json:"merchant_id"`
}

type SecretInfo added in v3.80.5

type SecretInfo struct {
	Permissions PermissionsJSON
	Team        TeamJSON
}

func AnalyzePermissions

func AnalyzePermissions(cfg *config.Config, key string) (*SecretInfo, error)

type TeamJSON

type TeamJSON struct {
	TeamMembers []struct {
		IsOwner   bool   `json:"is_owner"`
		FirstName string `json:"given_name"`
		LastName  string `json:"family_name"`
		Email     string `json:"email_address"`
		CreatedAt string `json:"created_at"`
	} `json:"team_members"`
}

Jump to

Keyboard shortcuts

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