package sql

import "github.com/jen20/riviera/azure"

type CreateOrUpdateFirewallRuleResponse struct {
	ID             *string `mapstructure:"id"`
	Name           *string `mapstructure:"name"`
	Location       *string `mapstructure:"location"`
	StartIpAddress *string `json:"startIpAddress,omitempty"`
	EndIpAddress   *string `json:"endIpAddress,omitempty"`
}

type CreateOrUpdateFirewallRule struct {
	Name              string  `json:"-"`
	ResourceGroupName string  `json:"-"`
	ServerName        string  `json:"-"`
	StartIpAddress    *string `json:"startIpAddress,omitempty"`
	EndIpAddress      *string `json:"endIpAddress,omitempty"`
}

func (s CreateOrUpdateFirewallRule) APIInfo() azure.APIInfo {
	return azure.APIInfo{
		APIVersion:  apiVersion,
		Method:      "PUT",
		URLPathFunc: sqlServerFirewallDefaultURLPath(s.ResourceGroupName, s.ServerName, s.Name),
		ResponseTypeFunc: func() interface{} {
			return &CreateOrUpdateFirewallRuleResponse{}
		},
	}
}

package sql

import "github.com/jen20/riviera/azure"

type CreateOrUpdateFirewallRuleResponse struct {
	ID             *string `mapstructure:"id"`
	Name           *string `mapstructure:"name"`
	Location       *string `mapstructure:"location"`
	StartIPAddress *string `json:"startIpAddress,omitempty"`
	EndIPAddress   *string `json:"endIpAddress,omitempty"`
}

type CreateOrUpdateFirewallRule struct {
	Name              string  `json:"-"`
	ResourceGroupName string  `json:"-"`
	ServerName        string  `json:"-"`
	StartIPAddress    *string `json:"startIpAddress,omitempty"`
	EndIPAddress      *string `json:"endIpAddress,omitempty"`
}

func (s CreateOrUpdateFirewallRule) APIInfo() azure.APIInfo {
	return azure.APIInfo{
		APIVersion:  apiVersion,
		Method:      "PUT",
		URLPathFunc: sqlServerFirewallDefaultURLPath(s.ResourceGroupName, s.ServerName, s.Name),
		ResponseTypeFunc: func() interface{} {
			return &CreateOrUpdateFirewallRuleResponse{}
		},
	}
}

Change Ip => IP for idiomatic Go
sql: Change Ip => IP for idiomatic Go
