dfmanager

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager in charge of all actions related to DialogFlow

Example
f, err := ioutil.ReadFile("someFileName")
checkError(err)

m, err := NewManager(f, "myDFProject")
checkError(err)

err = m.ExportToFile("export.zip")
checkError(err)
Output:

func NewManager

func NewManager(prjKey []byte, prjName string) (*Manager, error)

NewManager parses cli context and builds DFManager instance based on provided args

func (*Manager) BatchUpdateEntities added in v1.0.4

func (m *Manager) BatchUpdateEntities(name string, entities []*dialogflow.GoogleCloudDialogflowV2EntityTypeEntity) error

BatchUpdateEntities updates entities for one given group in batch manner

func (*Manager) Export

func (m *Manager) Export() (string, error)

Export downloads Dialogflow agent and returns it as BASE64 encoded zip archive string

func (*Manager) ExportToFile added in v1.0.2

func (m *Manager) ExportToFile(fName string) error

ExportToFile downloads Dialogflow agent and saves to file If file name is not provided, file with GCP project name and extension .zip will be created in work directory

func (*Manager) Import

func (m *Manager) Import(content string) error

Import expects content to be BASE64 encoded zip agent content

func (*Manager) ImportFile added in v1.0.2

func (m *Manager) ImportFile(fName string) error

ImportFile reads archive and uploads it to Dialogflow

func (*Manager) ListEntityTypes added in v1.0.4

func (m *Manager) ListEntityTypes() ([]*dialogflow.GoogleCloudDialogflowV2EntityType, error)

ListEntityTypes reads and returns list of all entities that belong to the project

func (*Manager) Restore

func (m *Manager) Restore(content string) error

Restore reads content (BASE64 encoded agent zip archive) and restores it in Dialogflow

func (*Manager) RestoreFile added in v1.0.2

func (m *Manager) RestoreFile(fName string) error

RestoreFile reads archive and restores it in Dialogflow

Jump to

Keyboard shortcuts

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