Skip to content

Commit

Permalink
Merge pull request #9 from azaurus1/hotfix/UserResponse
Browse files Browse the repository at this point in the history
fixing mismatched response types
  • Loading branch information
azaurus1 authored Feb 25, 2024
2 parents 08f199e + ae9aa4d commit eef1520
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions go-pinot-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (c *PinotAPIClient) GetSchemas() (*GetSchemaResponse, error) {

// CreateSchema creates a new schema.
// if it already exists, it will nothing will happen
func (c *PinotAPIClient) CreateSchema(schema model.Schema) (*CreateUsersResponse, error) {
func (c *PinotAPIClient) CreateSchema(schema model.Schema) (*model.UserActionResponse, error) {

// validate schema first
schemaResp, err := c.ValidateSchema(schema)
Expand All @@ -302,7 +302,7 @@ func (c *PinotAPIClient) CreateSchema(schema model.Schema) (*CreateUsersResponse
return nil, fmt.Errorf("schema is invalid: %s", schemaResp.Error)
}

var result CreateUsersResponse
var result model.UserActionResponse

schemaBytes, err := schema.AsBytes()
if err != nil {
Expand All @@ -314,7 +314,7 @@ func (c *PinotAPIClient) CreateSchema(schema model.Schema) (*CreateUsersResponse
}

// CreateSchemaFromFile creates a new schema from a file and uses CreateSchema
func (c *PinotAPIClient) CreateSchemaFromFile(schemaFilePath string) (*CreateUsersResponse, error) {
func (c *PinotAPIClient) CreateSchemaFromFile(schemaFilePath string) (*model.UserActionResponse, error) {

f, err := os.Open(schemaFilePath)
if err != nil {
Expand Down Expand Up @@ -374,9 +374,9 @@ func (c *PinotAPIClient) ValidateSchema(schema model.Schema) (*ValidateSchemaRes
return &ValidateSchemaResponse{Ok: true}, nil
}

func (c *PinotAPIClient) UpdateSchema(schema model.Schema) (*CreateUsersResponse, error) {
func (c *PinotAPIClient) UpdateSchema(schema model.Schema) (*model.UserActionResponse, error) {

var result CreateUsersResponse
var result model.UserActionResponse

schemaBytes, err := schema.AsBytes()
if err != nil {
Expand Down

0 comments on commit eef1520

Please sign in to comment.