code: func (n *NetworkServerAPI) UpdateGatewayProfile(ctx context.Context, req *ns.UpdateGatewayProfileRequest) (*empty.Empty, error) {
  	if req.GatewayProfile == nil {
  		return nil, grpc.Errorf(codes.InvalidArgument, "gateway_profile must not be nil")
  	}
  
  	var gpID uuid.UUID
  	copy(gpID[:], req.GatewayProfile.Id)
  
  	gc, err := storage.GetGatewayProfile(storage.DB(), gpID)
  	if err != nil {
  		return nil, errToRPCError(err)
  	}
  
  	gc.Channels = []int64{}
  	for _, c := range req.GatewayProfile.Channels {
  		gc.Channels = append(gc.Channels, int64(c))
  	}
  
  	gc.ExtraChannels = []storage.ExtraChannel{}
  	for _, ec := range req.GatewayProfile.ExtraChannels {
  		c := storage.ExtraChannel{
  			Frequency: int(ec.Frequency),
  			Bandwidth: int(ec.Bandwidth),
  			Bitrate:   int(ec.Bitrate),
  		}
  
  		switch ec.Modulation {
  		case common.Modulation_FSK:
  			c.Modulation = storage.ModulationFSK
  		default:
  			c.Modulation = storage.ModulationLoRa
  		}
  
  		for _, sf := range ec.SpreadingFactors {
  			c.SpreadingFactors = append(c.SpreadingFactors, int64(sf))
  		}
  
  		gc.ExtraChannels = append(gc.ExtraChannels, c)
  	}
  
  	err = storage.Transaction(func(tx sqlx.Ext) error {
  		return storage.UpdateGatewayProfile(tx, &gc)
  	})
  	if err != nil {
  		return nil, errToRPCError(err)
  	}
  
  	return &empty.Empty{}, nil
  }
docs: // UpdateGatewayProfile updates the given gateway-profile.