// NewDeviceLinkFailDetails returns a new DeviceLinkFailDetails instance
8897
func NewDeviceLinkFailDetails(DeviceType *DeviceType) *DeviceLinkFailDetails {
	s := new(DeviceLinkFailDetails)
	s.DeviceType = DeviceType
	return s
}
1271135
func NewAppUnlinkTeamDetails(AppInfo IsAppLogInfo) *AppUnlinkTeamDetails {
	s := new(AppUnlinkTeamDetails)
	s.AppInfo = AppInfo
	return s
}
1289265
func NewSharedLinkChangeVisibilityDetails(NewValue *SharedLinkVisibility) *SharedLinkChangeVisibilityDetails {
	s := new(SharedLinkChangeVisibilityDetails)
	s.NewValue = NewValue
	return s
}
264971
func (s *SignUpOutput) SetCodeDeliveryDetails(v *CodeDeliveryDetailsType) *SignUpOutput {
	s.CodeDeliveryDetails = v
	return s
}
859647
func NewDeviceDeleteOnUnlinkFailType(Description string) *DeviceDeleteOnUnlinkFailType {
	s := new(DeviceDeleteOnUnlinkFailType)
	s.Description = Description
	return s
}
1204523
func NewPaperFolderFollowedDetails(EventUuid string) *PaperFolderFollowedDetails {
	s := new(PaperFolderFollowedDetails)
	s.EventUuid = EventUuid
	return s
}
962631
func (c *Client) GetDeviceProfileById(id string) (contract.DeviceProfile, error) {
	conn := c.Pool.Get()
	defer conn.Close()

	var d contract.DeviceProfile
	err := getObjectById(conn, id, unmarshalDeviceProfile, &d)
	return d, err
}
144572
func NewDomainVerificationAddDomainFailDetails(DomainName string) *DomainVerificationAddDomainFailDetails {
	s := new(DomainVerificationAddDomainFailDetails)
	s.DomainName = DomainName
	return s
}
1110549
func (s *DefaultSubscriber) SubscribeDeviceDownlink(appID, devID string, handler DownlinkHandler) error {
	key := DeviceKey{appID, devID, DeviceDownlink, ""}
	messages, err := s.subscribe(key.String())
	if err != nil {
		return err
	}

	go func() {
		for delivery := range messages {
			dataDown := &types.DownlinkMessage{}
			err := json.Unmarshal(delivery.Body, dataDown)
			if err != nil {
				s.ctx.Warnf("Could not unmarshal downlink %v (%s)", delivery, err)
				continue
			}
			handler(s, dataDown.AppID, dataDown.DevID, *dataDown)
			delivery.Ack(false)
		}
	}()

	return nil
}
943266
func NewDeviceUnlinkDetails(DeleteData bool) *DeviceUnlinkDetails {
	s := new(DeviceUnlinkDetails)
	s.DeleteData = DeleteData
	return s
}
1254859
func (s deviceService) DeviceDetails(devices []string) (*DeviceDetailsResponse, error) {
	request := struct {
		Devices []string `json:"devices"`
	}{
		Devices: devices,
	}
	var response DeviceDetailsResponse
	req, err := s.client.NewRequest("POST", deviceDetailsPath, request)
	if err != nil {
		return nil, err
	}
	err = s.client.Do(req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}
693310
func NewMAVLinkPacket(Protocol uint8, Length uint8, Sequence uint8, SystemID uint8, ComponentID uint8, MessageID uint8, Data []uint8) *MAVLinkPacket {
	m := &MAVLinkPacket{
		Protocol:    Protocol,
		Length:      Length,
		Sequence:    Sequence,
		SystemID:    SystemID,
		ComponentID: ComponentID,
		MessageID:   MessageID,
		Data:        Data,
	}
	m.Checksum = crcCalculate(m)
	return m
}
1245257
func (m *MachineShim) AllLinkLayerDevices() ([]LinkLayerDevice, error) {
	devs, err := m.Machine.AllLinkLayerDevices()
	if err != nil {
		return nil, errors.Trace(err)
	}

	wrapped := make([]LinkLayerDevice, len(devs))
	for i, d := range devs {
		wrapped[i] = &linkLayerDevice{d}
	}
	return wrapped, nil
}
1308972
func NewDeviceID(rawCert []byte) DeviceID {
	var n DeviceID
	hf := sha256.New()
	hf.Write(rawCert)
	hf.Sum(n[:0])
	return n
}
1086351
func (s *ResourcemetadataService) NewAddResourceDetailParams(details map[string]string, resourceid string, resourcetype string) *AddResourceDetailParams {
	p := &AddResourceDetailParams{}
	p.p = make(map[string]interface{})
	p.p["details"] = details
	p.p["resourceid"] = resourceid
	p.p["resourcetype"] = resourcetype
	return p
}
1199762
func NewDeviceStatisticsNamespace(db *Lowlevel, device string) *NamespacedKV {
	return NewNamespacedKV(db, string(KeyTypeDeviceStatistic)+device)
}
1061227
func CreateNewMobileGateway(values *CreateMobileGatewayValue, setting *MobileGatewaySetting) (*MobileGateway, error) {

	lb := &MobileGateway{
		Appliance: &Appliance{
			Class:           "mobilegateway",
			propName:        propName{Name: values.Name},
			propDescription: propDescription{Description: values.Description},
			propTags:        propTags{Tags: values.Tags},
			propPlanID:      propPlanID{Plan: &Resource{ID: int64(MobileGatewayPlanStandard)}},
			propIcon: propIcon{
				&Icon{
					Resource: NewResource(values.IconID),
				},
			},
		},
		Remark: &MobileGatewayRemark{
			ApplianceRemarkBase: &ApplianceRemarkBase{
				Switch: &ApplianceRemarkSwitch{
					propScope: propScope{
						Scope: "shared",
					},
				},
				Servers: []interface{}{
					nil,
				},
			},
		},
		Settings: &MobileGatewaySettings{
			MobileGateway: setting,
		},
	}

	return lb, nil
}