Sha256: 685c63c32e61ab20768c70ed9c50de65df97b0d1b70e769675c06b27eeab02b7

Contents?: true

Size: 899 Bytes

Versions: 36

Compression:

Stored size: 899 Bytes

Contents

package <%= package %>

// Type for resource <%= resource.full_dot_name %>
type <%= resource.go_type %> struct {
	// Pointer to client
	Client *Client

<% resource.resources.each do |r| -%>
	// Resource <%= r.full_dot_name %>
	<%= r.go_name %> *<%= r.go_type %>
<% end -%>
<% resource.actions.each do |a| -%>
<% a.all_names do |go_name| -%>
	// Action <%= a.full_dot_name %>
	<%= go_name %> *<%= a.go_type %>
<% end -%>
<% end -%>
}

func New<%= resource.go_type %>(client *Client) *<%= resource.go_type %> {
<% resource.actions.each do |a| -%>
	action<%= a.go_name %> := New<%= a.go_type %>(client)
<% end -%>

	return &<%= resource.go_type %>{
		Client: client,
<% resource.resources.each do |r| -%>
		<%= r.go_name %>: New<%= r.go_type %>(client),
<% end -%>
<% resource.actions.each do |a| -%>
<% a.all_names do |go_name| -%>
		<%= go_name %>: action<%= a.go_name %>,
<% end -%>
<% end -%>
	}
}

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
haveapi-go-client-0.25.0 template/resource.go.erb
haveapi-go-client-0.24.0 template/resource.go.erb
haveapi-go-client-0.23.7 template/resource.go.erb
haveapi-go-client-0.23.6 template/resource.go.erb
haveapi-go-client-0.23.5 template/resource.go.erb
haveapi-go-client-0.23.4 template/resource.go.erb
haveapi-go-client-0.23.3 template/resource.go.erb
haveapi-go-client-0.23.2 template/resource.go.erb
haveapi-go-client-0.23.1 template/resource.go.erb
haveapi-go-client-0.23.0 template/resource.go.erb
haveapi-go-client-0.22.1 template/resource.go.erb
haveapi-go-client-0.22.0 template/resource.go.erb
haveapi-go-client-0.21.1 template/resource.go.erb
haveapi-go-client-0.21.0 template/resource.go.erb
haveapi-go-client-0.20.0 template/resource.go.erb
haveapi-go-client-0.19.3 template/resource.go.erb
haveapi-go-client-0.19.2 template/resource.go.erb
haveapi-go-client-0.19.1 template/resource.go.erb
haveapi-go-client-0.19.0 template/resource.go.erb
haveapi-go-client-0.18.2 template/resource.go.erb