Skip to content

Commit 788b838

Browse files
committed
Use organization ID in iot-client calls
1 parent 0c63960 commit 788b838

File tree

21 files changed

+30
-25
lines changed

21 files changed

+30
-25
lines changed

command/dashboard/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type CreateParams struct {
3434

3535
// Create allows to create a new dashboard.
3636
func Create(params *CreateParams, cred *config.Credentials) (*DashboardInfo, error) {
37-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
37+
iotClient, err := iot.NewClient(cred)
3838
if err != nil {
3939
return nil, err
4040
}

command/dashboard/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type DeleteParams struct {
3131
// Delete command is used to delete a dashboard
3232
// from Arduino IoT Cloud.
3333
func Delete(params *DeleteParams, cred *config.Credentials) error {
34-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
34+
iotClient, err := iot.NewClient(cred)
3535
if err != nil {
3636
return err
3737
}

command/dashboard/extract.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type ExtractParams struct {
3434
// Extract command is used to extract a dashboard template
3535
// from a dashboard on Arduino IoT Cloud.
3636
func Extract(params *ExtractParams, cred *config.Credentials) (map[string]interface{}, error) {
37-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
37+
iotClient, err := iot.NewClient(cred)
3838
if err != nil {
3939
return nil, err
4040
}

command/dashboard/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
// List command is used to list
2626
// the dashboards of Arduino IoT Cloud.
2727
func List(cred *config.Credentials) ([]DashboardInfo, error) {
28-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
28+
iotClient, err := iot.NewClient(cred)
2929
if err != nil {
3030
return nil, err
3131
}

command/device/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Create(params *CreateParams, cred *config.Credentials) (*DeviceInfo, error)
6363
)
6464
}
6565

66-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
66+
iotClient, err := iot.NewClient(cred)
6767
if err != nil {
6868
return nil, err
6969
}

command/device/creategeneric.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type DeviceGenericInfo struct {
4444

4545
// CreateGeneric command is used to add a new generic device to Arduino IoT Cloud.
4646
func CreateGeneric(params *CreateGenericParams, cred *config.Credentials) (*DeviceGenericInfo, error) {
47-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
47+
iotClient, err := iot.NewClient(cred)
4848
if err != nil {
4949
return nil, err
5050
}

command/device/createlora.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func CreateLora(params *CreateLoraParams, cred *config.Credentials) (*DeviceLora
107107
return nil, err
108108
}
109109

110-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
110+
iotClient, err := iot.NewClient(cred)
111111
if err != nil {
112112
return nil, err
113113
}

command/device/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func Delete(params *DeleteParams, cred *config.Credentials) error {
4343
return errors.New("cannot use both ID and Tags. only one of them should be not nil")
4444
}
4545

46-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
46+
iotClient, err := iot.NewClient(cred)
4747
if err != nil {
4848
return err
4949
}

command/device/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type ListParams struct {
3333
// List command is used to list
3434
// the devices of Arduino IoT Cloud.
3535
func List(params *ListParams, cred *config.Credentials) ([]DeviceInfo, error) {
36-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
36+
iotClient, err := iot.NewClient(cred)
3737
if err != nil {
3838
return nil, err
3939
}

command/device/listfrequency.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type FrequencyPlanInfo struct {
3434
// ListFrequencyPlans command is used to list
3535
// the supported LoRa frequency plans.
3636
func ListFrequencyPlans(cred *config.Credentials) ([]FrequencyPlanInfo, error) {
37-
iotClient, err := iot.NewClient(cred.Client, cred.Secret)
37+
iotClient, err := iot.NewClient(cred)
3838
if err != nil {
3939
return nil, err
4040
}

0 commit comments

Comments
 (0)