package client

type RancherClient struct {
    RancherBaseClient
	{{range .schemas}}
    {{.Id}} {{.Id}}Operations{{end}}
}

func constructClient(rancherBaseClient *RancherBaseClientImpl) *RancherClient {
	client := &RancherClient{
        RancherBaseClient: rancherBaseClient,
    }

    {{range .schemas}}
    client.{{.Id}} = new{{.Id}}Client(client){{end}}


	return client
}

func NewRancherClient(opts *ClientOpts) (*RancherClient, error) {
    rancherBaseClient := &RancherBaseClientImpl {
        Types: map[string]Schema{},
    }
    client := constructClient(rancherBaseClient)

    err := setupRancherBaseClient(rancherBaseClient, opts)
    if err != nil {
        return nil, err
    }

    return client, nil
}
