text:
// Package encfile implements encrypted paged files
package encfile

import (
	"crypto/aes"
	"crypto/rand"
	"errors"
	"io"
	"os"

	"golang.org/x/crypto/scrypt"
	"golang.org/x/crypto/xts"
)

// KeySize is the _raw_ keysize
const KeySize = 64

// BlockSize of XTS cipher
const BlockSize = 16

const saltSize = 32
const gcmVer = 16
const encKeySize = KeySize + gcmVer
const headerSize = saltSize + encKeySize
const fileMode = os.ModePerm & 0600
const sectorFooter = gcmVer

// RandomSource of the packet
var RandomSource = rand.Reader

var (
	// ScryptN scrypt n param
	ScryptN = 16384
	// ScryptR scrypt r param
	ScryptR = 8
	// ScryptP scrypt p param
	ScryptP = 1
)

// ErrSectorSize .
var ErrSectorSize = errors.New("Sectorsize is no multiple of blocksize")

// EncryptedFile implements seekable file encryption
type EncryptedFile struct {
	filename   string
	encFunc    *xts.Cipher
	sectorSize int
	fd         *os.File
	salt       []byte
	encKey     []byte
	realKey    []byte
	seekPos    int64
}

func (ef *EncryptedFile) genKeyG(passphrase []byte) ([]byte, error) {
	if len(passphrase) == KeySize {
		return passphrase, nil
	}
	keyG, err := scrypt.Key(passphrase, ef.salt[:saltSize], ScryptN, ScryptR, ScryptP, KeySize)
	if err != nil {
		return nil, err
	}
	return keyG, nil
}

// ChangePass change passphrase of filename from old to new
func ChangePass(filename string, oldPassphrase, newPassphrase []byte) error {
	ef, err := Open(filename, oldPassphrase, BlockSize)
	if err != nil {
		return err
	}
	defer ef.Close()
	keyG, err := ef.genKeyG(newPassphrase)
	if err != nil {
		return err
	}
	ef.encKey = encryptSector(keyG, ef.salt, ef.realKey)
	if _, err := ef.fd.Write(ef.salt); err != nil {
		return err
	}
	if _, err := ef.fd.Write(ef.encKey); err != nil {
		return err
	}
	ef.fd.Sync()
	ef.fd.Close()
	return nil
}

// New returns a handle on an encrypted file
func New(filename string, passphrase []byte, sectorSize int) (*EncryptedFile, error) {
	var err error
	if sectorSize%BlockSize != 0 {
		return nil, ErrSectorSize
	}
	ef := new(EncryptedFile)
	ef.seekPos = -1
	ef.filename = filename
	ef.sectorSize = sectorSize
	ef.salt, ef.encKey = ef.readHeader()
	keyG, err := ef.genKeyG(passphrase)
	if err != nil {
		return nil, err
	}
	if ef.encKey == nil {
		ef.realKey = make([]byte, KeySize)
		_, err := io.ReadFull(RandomSource, ef.realKey)
		if err != nil {
			panic(err)
		}
		ef.encKey = encryptSector(keyG, ef.salt, ef.realKey)
	} else {
		ef.realKey, err = decryptSector(keyG, ef.salt, ef.encKey)
		if err != nil {
			return nil, err
		}
	}
	ef.encFunc, err = xts.NewCipher(aes.NewCipher, ef.realKey[:32])
	if err != nil {
		return nil, err
	}
	return ef, nil
}

func open(filename string, passphrase []byte, sectorSize int, openFlags int, doesExist bool) (*EncryptedFile, error) {
	var err error
	ef, err := New(filename, passphrase, sectorSize)
	if err != nil {
		return nil, err
	}
	existTest := ef.fileExists()
	if doesExist {
		if !existTest {
			return nil, os.ErrNotExist
		}
	} else {
		if existTest {
			return nil, os.ErrExist
		}
	}
	ef.fd, err = os.OpenFile(ef.filename, openFlags, fileMode)
	if err != nil {
		return nil, err
	}
	if !doesExist {
		ef.fd.Write(ef.salt)
		ef.fd.Write(ef.encKey)
		ef.fd.Sync()
	}
	return ef, nil
}

// Open a file for read and write, MUST exist
func Open(filename string, passphrase []byte, sectorSize int) (*EncryptedFile, error) {
	return open(filename, passphrase, sectorSize, os.O_RDWR, true)
}

// Create a file. May not exist
func Create(filename string, passphrase []byte, sectorSize int) (*EncryptedFile, error) {
	return open(filename, passphrase, sectorSize, os.O_RDWR|os.O_CREATE|os.O_EXCL, false)
}

// Append a file. Must exist
func Append(filename string, passphrase []byte, sectorSize int) (*EncryptedFile, error) {
	return open(filename, passphrase, sectorSize, os.O_WRONLY|os.O_APPEND, true)
}

// View a file. Open for reading only. Must exist
func View(filename string, passphrase []byte, sectorSize int) (*EncryptedFile, error) {
	return open(filename, passphrase, sectorSize, os.O_RDONLY, true)
}

// Stat of file
func (ef *EncryptedFile) Stat() (os.FileInfo, error) {
	if ef == nil {
		return nil, os.ErrInvalid
	}
	return ef.fd.Stat()
}

// Sync the file
func (ef *EncryptedFile) Sync() error {
	if ef == nil {
		return os.ErrInvalid
	}
	return ef.fd.Sync()
}

// Close the file
func (ef *EncryptedFile) Close() error {
	if ef == nil {
		return os.ErrInvalid
	}
	return ef.fd.Close()
}

func (ef *EncryptedFile) readHeader() (salt []byte, encKey []byte) {
	header := make([]byte, headerSize)
	if ef.fileExists() {
		f, err := os.Open(ef.filename)
		if err != nil {
			panic(err)
		}
		defer f.Close()
		_, err = f.Read(header)
		if err != nil {
			panic(err)
		}
		return header[:saltSize], header[saltSize : saltSize+encKeySize]
	}
	_, err := io.ReadFull(RandomSource, header)
	if err != nil {
		panic(err)
	}
	return header[:saltSize], nil
}

func (ef *EncryptedFile) fileExists() bool {
	return FileExists(ef.filename)
}

// FileExists returns true if the file exists, false if not
func FileExists(filename string) bool {
	_, err := os.Stat(filename)
	if err == nil {
		return true
	}
	return false
}

// ReadSector sector
func (ef *EncryptedFile) ReadSector(sector uint64) ([]byte, error) {
	ef.seekPos = -1
	if err := ef.seekSector(sector); err != nil {
		return nil, err
	}
	secData := make([]byte, ef.sectorSize+sectorFooter)
	n, err := ef.fd.Read(secData)
	if err != nil {
		return nil, err
	}
	if n < ef.sectorSize+sectorFooter {
		return nil, os.ErrNotExist
	}
	return decryptSector(ef.realKey[32:], ef.salt, secData)
}

// PadSector cuts or pads data to fit sector
func (ef *EncryptedFile) PadSector(data []byte) []byte {
	l := len(data)
	if l == ef.sectorSize {
		return data
	}
	if l > ef.sectorSize {
		return data[:ef.sectorSize]
	}
	ndata := make([]byte, ef.sectorSize)
	copy(ndata, data)
	return ndata
}

// WriteSector sector with data
func (ef *EncryptedFile) WriteSector(sector uint64, data []byte) error {
	ef.seekPos = -1
	if len(data) != ef.sectorSize {
		return os.ErrInvalid
	}
	if err := ef.seekSector(sector); err != nil {
		return err
	}
	secData := encryptSector(ef.realKey[32:], ef.salt, data)
	n, err := ef.fd.Write(secData)
	if err != nil {
		return err
	}
	if n < ef.sectorSize+sectorFooter {
		return os.ErrNotExist
	}
	return nil
}

// WriteSectorSync sector with data synched
func (ef *EncryptedFile) WriteSectorSync(sector uint64, data []byte) error {
	if err := ef.WriteSector(sector, data); err != nil {
		return err
	}
	if err := ef.Sync(); err != nil {
		return err
	}
	return nil
}

// WriteSectorPad writes partial data to the sector, zeroing out any additonal data in the sector
func (ef *EncryptedFile) WriteSectorPad(sector uint64, data []byte) error {
	data = ef.PadSector(data)
	return ef.WriteSector(sector, data)
}

func (ef *EncryptedFile) seekSector(sector uint64) error {
	seekPos := ef.calcSeek(sector)
	ret, err := ef.fd.Seek(seekPos, os.SEEK_SET)
	if err != nil {
		return err
	}
	if ret != seekPos {
		return os.ErrNotExist
	}
	return nil
}

// calcSeek calculate seek position from sector number
func (ef *EncryptedFile) calcSeek(sector uint64) int64 {
	return int64(headerSize + (sector * uint64(ef.sectorSize+sectorFooter)))
}

// CountSector returns the number of sectors in the file
func (ef *EncryptedFile) CountSector() uint64 {
	fi, err := ef.Stat()
	if err != nil {
		return 0
	}
	c := (fi.Size() - headerSize) / int64(ef.sectorSize+sectorFooter)
	if c <= 0 {
		return 0
	}
	return uint64(c)
}

// ZeroSector overwrites the sector with random data. Reading it will fail!
func (ef *EncryptedFile) ZeroSector(sector uint64) error {
	r := make([]byte, ef.sectorSize+sectorFooter)
	_, err := io.ReadFull(RandomSource, r)
	if err != nil {
		panic(err)
	}
	if err := ef.seekSector(sector); err != nil {
		return err
	}
	_, err = ef.fd.Write(r)
	return err
}

// Delete file by overwriting
func (ef *EncryptedFile) Delete() error {
	sector := uint64(0)
	totalSectors := ef.CountSector()
	for {
		err := ef.ZeroSector(sector)
		if err != nil && sector != totalSectors {
			return err
		}
		if sector >= totalSectors {
			break
		}
		sector++
	}
	if sector < totalSectors {
		return os.ErrInvalid
	}
	ef.fd.Seek(0, os.SEEK_SET)
	rr := make([]byte, headerSize)
	io.ReadFull(RandomSource, rr)
	_, err := ef.fd.Write(rr)
	if err != nil {
		return err
	}
	ef.fd.Sync()
	ef.fd.Truncate(0)
	ef.fd.Sync()
	ef.fd.Close()
	return os.Remove(ef.filename)
}

// Seek to relative off
func (ef *EncryptedFile) Seek(off int64) int64 {
	ef.seekPos = off
	return off
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func byteCopy(dst, src []byte) int {
	n := min(len(dst), len(src))
	for i := 0; i < n; i++ {
		dst[i] = src[i]
	}
	return n
}

func (ef *EncryptedFile) calcSectorOffset(off int64) (sector uint64, skip int) {
	if off < 0 {
		panic("negative offset")
	}
	sector = uint64(off / int64(ef.sectorSize))
	skip = int(off % int64(ef.sectorSize))
	return
}

// readPartial reads into b from position p. it starts writing to b at bpos, and at sector at secpos
func (ef *EncryptedFile) readPartial(sector uint64, b []byte, bpos, secpos int) (int, error) {
	d, err := ef.ReadSector(sector)
	if err != nil {
		return 0, err
	}
	n := byteCopy(b[bpos:], d[secpos:])
	return n, nil
}

// writePartial writes to sector starting with secpos bytes from b starting with bpos
func (ef *EncryptedFile) writePartial(sector uint64, b []byte, secpos, bpos int) (int, error) {
	var d []byte
	//  Dont read if we write a full sector matching sector boundary
	if len(b)-bpos >= ef.sectorSize && secpos == 0 {
		if err := ef.WriteSector(sector, b[bpos:bpos+ef.sectorSize]); err != nil {
			return 0, err
		}
		return ef.sectorSize, nil
	}
	// Write not matching sector boundaries, need that data first
	d, err := ef.ReadSector(sector)
	if err != nil {
		if err != io.EOF {
			return 0, err
		}
		d = make([]byte, ef.sectorSize)
	}
	n := byteCopy(d[secpos:], b[bpos:])
	if err := ef.WriteSector(sector, d); err != nil {
		return 0, err
	}
	return n, nil
}

// ReadAt position
func (ef *EncryptedFile) ReadAt(b []byte, off int64) (n int, err error) {
	l := len(b)
	sector, skip := ef.calcSectorOffset(off) // first sector
	n, err = ef.readPartial(sector, b, 0, skip)
	if err != nil {
		return n, err
	}
	// Read all sectors left that dont start partial
	for x := l - n; x > 0; x -= ef.sectorSize {
		sector++
		nt, err := ef.readPartial(sector, b, n, 0)
		n += nt
		if err != nil {
			return n, err
		}
	}
	return n, nil
}

// WriteAt b to off
func (ef *EncryptedFile) WriteAt(b []byte, off int64) (n int, err error) {
	l := len(b)
	sector, skip := ef.calcSectorOffset(off)     // first sector
	n, err = ef.writePartial(sector, b, skip, 0) // Write first part
	for x := l - n; x > 0; x -= ef.sectorSize {
		sector++
		nt, err := ef.writePartial(sector, b, 0, n)
		n += nt
		if err != nil {
			return n, err
		}
	}
	return n, err
}

// Read form current position
func (ef *EncryptedFile) Read(b []byte) (n int, err error) {
	if ef.seekPos == -1 {
		return 0, os.ErrInvalid
	}
	n, err = ef.ReadAt(b, ef.seekPos)
	ef.seekPos += int64(n)
	return n, err
}

// Write b to file at current position
func (ef *EncryptedFile) Write(b []byte) (n int, err error) {
	if ef.seekPos == -1 {
		return 0, os.ErrInvalid
	}
	n, err = ef.WriteAt(b, ef.seekPos)
	ef.seekPos += int64(n)
	return n, err
}

repository: JonathanLogan/encfile

repo_name: JonathanLogan/encfile


text:
@article{Sun:2016:MVP,
 author = {Sun, Qi and Wei, Li-Yi and Kaufman, Arie},
 title = {Mapping Virtual and Physical Reality},
 journal = {ACM Trans. Graph.},
 issue_date = {July 2016},
 volume = {35},
 number = {4},
 month = jul,
 year = {2016},
 issn = {0730-0301},
 pages = {64:1--64:12},
 articleno = {64},
 numpages = {12},
 url = {http://doi.acm.org/10.1145/2897824.2925883},
 doi = {10.1145/2897824.2925883},
 acmid = {2925883},
 keywords = {camera projection, geometry morphing, head-mounted display, human perception, planar map, real-time rendering, redirected walking, virtual reality, warped space},
}

@misc{StackExchange:2011:HLI,
 title = {How to link images relatively in Inkscape?},
 author = {Stackexchange},
 year = {2011},
 note = {\url{http://graphicdesign.stackexchange.com/questions/4906/how-to-link-images-relatively-in-inkscape}},
}%misc

license: MIT

license_type: permissive

branch_name: refs/heads/master

gha_license_id: MIT

extension: bib


text:
/*
 * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef TENCENTCLOUD_CPDP_V20190820_MODEL_QUERYITEM_H_
#define TENCENTCLOUD_CPDP_V20190820_MODEL_QUERYITEM_H_

#include <string>
#include <vector>
#include <map>
#include <tencentcloud/core/utils/rapidjson/document.h>
#include <tencentcloud/core/utils/rapidjson/writer.h>
#include <tencentcloud/core/utils/rapidjson/stringbuffer.h>
#include <tencentcloud/core/AbstractModel.h>

namespace TencentCloud
{
    namespace Cpdp
    {
        namespace V20190820
        {
            namespace Model
            {
                /**
                * 聚鑫商户余额查询输出项
                */
                class QueryItem : public AbstractModel
                {
                public:
                    QueryItem();
                    ~QueryItem() = default;
                    void ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const;
                    CoreInternalOutcome Deserialize(const rapidjson::Value &value);

                    /**
                     * 获取子商户账户
                     * @return SubAcctNo 子商户账户
                     *
                     */
                    std::string GetSubAcctNo() const;

                    /**
                     * 设置子商户账户
                     * @param _subAcctNo 子商户账户
                     *
                     */
                    void SetSubAcctNo(const std::string& _subAcctNo);

                    /**
                     * 判断参数 SubAcctNo 是否已赋值
                     * @return SubAcctNo 是否已赋值
                     *
                     */
                    bool SubAcctNoHasBeenSet() const;

                    /**
                     * 获取子账户属性
1：普通会员子账号
2：挂账子账号
3：手续费子账号
4：利息子账号
5：平台担保子账号
                     * @return SubAcctProperty 子账户属性
1：普通会员子账号
2：挂账子账号
3：手续费子账号
4：利息子账号
5：平台担保子账号
                     *
                     */
                    std::string GetSubAcctProperty() const;

                    /**
                     * 设置子账户属性
1：普通会员子账号
2：挂账子账号
3：手续费子账号
4：利息子账号
5：平台担保子账号
                     * @param _subAcctProperty 子账户属性
1：普通会员子账号
2：挂账子账号
3：手续费子账号
4：利息子账号
5：平台担保子账号
                     *
                     */
                    void SetSubAcctProperty(const std::string& _subAcctProperty);

                    /**
                     * 判断参数 SubAcctProperty 是否已赋值
                     * @return SubAcctProperty 是否已赋值
                     *
                     */
                    bool SubAcctPropertyHasBeenSet() const;

                    /**
                     * 获取业务平台的子商户Id，唯一
                     * @return SubMchId 业务平台的子商户Id，唯一
                     *
                     */
                    std::string GetSubMchId() const;

                    /**
                     * 设置业务平台的子商户Id，唯一
                     * @param _subMchId 业务平台的子商户Id，唯一
                     *
                     */
                    void SetSubMchId(const std::string& _subMchId);

                    /**
                     * 判断参数 SubMchId 是否已赋值
                     * @return SubMchId 是否已赋值
                     *
                     */
                    bool SubMchIdHasBeenSet() const;

                    /**
                     * 获取子账户名称
                     * @return SubAcctName 子账户名称
                     *
                     */
                    std::string GetSubAcctName() const;

                    /**
                     * 设置子账户名称
                     * @param _subAcctName 子账户名称
                     *
                     */
                    void SetSubAcctName(const std::string& _subAcctName);

                    /**
                     * 判断参数 SubAcctName 是否已赋值
                     * @return SubAcctName 是否已赋值
                     *
                     */
                    bool SubAcctNameHasBeenSet() const;

                    /**
                     * 获取账户可用余额
                     * @return AcctAvailBal 账户可用余额
                     *
                     */
                    std::string GetAcctAvailBal() const;

                    /**
                     * 设置账户可用余额
                     * @param _acctAvailBal 账户可用余额
                     *
                     */
                    void SetAcctAvailBal(const std::string& _acctAvailBal);

                    /**
                     * 判断参数 AcctAvailBal 是否已赋值
                     * @return AcctAvailBal 是否已赋值
                     *
                     */
                    bool AcctAvailBalHasBeenSet() const;

                    /**
                     * 获取可提现金额
                     * @return CashAmt 可提现金额
                     *
                     */
                    std::string GetCashAmt() const;

                    /**
                     * 设置可提现金额
                     * @param _cashAmt 可提现金额
                     *
                     */
                    void SetCashAmt(const std::string& _cashAmt);

                    /**
                     * 判断参数 CashAmt 是否已赋值
                     * @return CashAmt 是否已赋值
                     *
                     */
                    bool CashAmtHasBeenSet() const;

                    /**
                     * 获取维护日期 开户日期或修改日期
                     * @return MaintenanceDate 维护日期 开户日期或修改日期
                     *
                     */
                    std::string GetMaintenanceDate() const;

                    /**
                     * 设置维护日期 开户日期或修改日期
                     * @param _maintenanceDate 维护日期 开户日期或修改日期
                     *
                     */
                    void SetMaintenanceDate(const std::string& _maintenanceDate);

                    /**
                     * 判断参数 MaintenanceDate 是否已赋值
                     * @return MaintenanceDate 是否已赋值
                     *
                     */
                    bool MaintenanceDateHasBeenSet() const;

                private:

                    /**
                     * 子商户账户
                     */
                    std::string m_subAcctNo;
                    bool m_subAcctNoHasBeenSet;

                    /**
                     * 子账户属性
1：普通会员子账号
2：挂账子账号
3：手续费子账号
4：利息子账号
5：平台担保子账号
                     */
                    std::string m_subAcctProperty;
                    bool m_subAcctPropertyHasBeenSet;

                    /**
                     * 业务平台的子商户Id，唯一
                     */
                    std::string m_subMchId;
                    bool m_subMchIdHasBeenSet;

                    /**
                     * 子账户名称
                     */
                    std::string m_subAcctName;
                    bool m_subAcctNameHasBeenSet;

                    /**
                     * 账户可用余额
                     */
                    std::string m_acctAvailBal;
                    bool m_acctAvailBalHasBeenSet;

                    /**
                     * 可提现金额
                     */
                    std::string m_cashAmt;
                    bool m_cashAmtHasBeenSet;

                    /**
                     * 维护日期 开户日期或修改日期
                     */
                    std::string m_maintenanceDate;
                    bool m_maintenanceDateHasBeenSet;

                };
            }
        }
    }
}

#endif // !TENCENTCLOUD_CPDP_V20190820_MODEL_QUERYITEM_H_

repository: TencentCloud/tencentcloud-sdk-cpp

repo_name: TencentCloud/tencentcloud-sdk-cpp

extension: h


text:
package health

import (
	"github.com/stretchr/testify/mock"
)

type MockMemberDiscovery struct {
	mock.Mock
}

func (m *MockMemberDiscovery) ConfigurationInit(initConfigServer []string) error {
	args := m.Called(initConfigServer)
	return args.Error(0)
}
func (m *MockMemberDiscovery) GetConfigServer() ([]string, error) {
	args := m.Called()
	return args.Get(0).([]string), args.Error(1)
}
func (m *MockMemberDiscovery) RefreshMembers() error {
	args := m.Called()
	return args.Error(0)
}
func (m *MockMemberDiscovery) Shuffle() error {
	args := m.Called()
	return args.Error(0)
}
func (m *MockMemberDiscovery) GetWorkingConfigCenterIP(entryPoint []string) ([]string, error) {
	args := m.Called(entryPoint)
	return args.Get(0).([]string), args.Error(0)
}

repository: Rajadeepan/mesher

repo_name: Rajadeepan/mesher

extension: go


text:
package appfw

type Appfwstats struct {
	Appfirewallaborts                                int    `json:"appfirewallaborts,omitempty"`
	Appfirewallabortsrate                            int    `json:"appfirewallabortsrate,omitempty"`
	Appfirewalllogbufferoverflow                     int    `json:"appfirewalllogbufferoverflow,omitempty"`
	Appfirewalllogbufferoverflowrate                 int    `json:"appfirewalllogbufferoverflowrate,omitempty"`
	Appfirewalllogcmd                                int    `json:"appfirewalllogcmd,omitempty"`
	Appfirewalllogcmdrate                            int    `json:"appfirewalllogcmdrate,omitempty"`
	Appfirewalllogcontenttype                        int    `json:"appfirewalllogcontenttype,omitempty"`
	Appfirewalllogcontenttyperate                    int    `json:"appfirewalllogcontenttyperate,omitempty"`
	Appfirewalllogcookie                             int    `json:"appfirewalllogcookie,omitempty"`
	Appfirewalllogcookiehijack                       int    `json:"appfirewalllogcookiehijack,omitempty"`
	Appfirewalllogcookiehijackrate                   int    `json:"appfirewalllogcookiehijackrate,omitempty"`
	Appfirewalllogcookierate                         int    `json:"appfirewalllogcookierate,omitempty"`
	Appfirewalllogcreditcard                         int    `json:"appfirewalllogcreditcard,omitempty"`
	Appfirewalllogcreditcardrate                     int    `json:"appfirewalllogcreditcardrate,omitempty"`
	Appfirewalllogcsrftag                            int    `json:"appfirewalllogcsrftag,omitempty"`
	Appfirewalllogcsrftagrate                        int    `json:"appfirewalllogcsrftagrate,omitempty"`
	Appfirewalllogdenyurl                            int    `json:"appfirewalllogdenyurl,omitempty"`
	Appfirewalllogdenyurlrate                        int    `json:"appfirewalllogdenyurlrate,omitempty"`
	Appfirewalllogfieldconsistency                   int    `json:"appfirewalllogfieldconsistency,omitempty"`
	Appfirewalllogfieldconsistencyrate               int    `json:"appfirewalllogfieldconsistencyrate,omitempty"`
	Appfirewalllogfieldformat                        int    `json:"appfirewalllogfieldformat,omitempty"`
	Appfirewalllogfieldformatrate                    int    `json:"appfirewalllogfieldformatrate,omitempty"`
	Appfirewalllogfileuploadtypes                    int    `json:"appfirewalllogfileuploadtypes,omitempty"`
	Appfirewalllogfileuploadtypesrate                int    `json:"appfirewalllogfileuploadtypesrate,omitempty"`
	Appfirewalllograte                               int    `json:"appfirewalllograte,omitempty"`
	Appfirewalllogrefererheader                      int    `json:"appfirewalllogrefererheader,omitempty"`
	Appfirewalllogrefererheaderrate                  int    `json:"appfirewalllogrefererheaderrate,omitempty"`
	Appfirewalllogsafeobject                         int    `json:"appfirewalllogsafeobject,omitempty"`
	Appfirewalllogsafeobjectrate                     int    `json:"appfirewalllogsafeobjectrate,omitempty"`
	Appfirewalllogsjsoncmd                           int    `json:"appfirewalllogsjsoncmd,omitempty"`
	Appfirewalllogsjsoncmdrate                       int    `json:"appfirewalllogsjsoncmdrate,omitempty"`
	Appfirewalllogsjsondos                           int    `json:"appfirewalllogsjsondos,omitempty"`
	Appfirewalllogsjsondosrate                       int    `json:"appfirewalllogsjsondosrate,omitempty"`
	Appfirewalllogsjsonsql                           int    `json:"appfirewalllogsjsonsql,omitempty"`
	Appfirewalllogsjsonsqlgram                       int    `json:"appfirewalllogsjsonsqlgram,omitempty"`
	Appfirewalllogsjsonsqlgramrate                   int    `json:"appfirewalllogsjsonsqlgramrate,omitempty"`
	Appfirewalllogsjsonsqlrate                       int    `json:"appfirewalllogsjsonsqlrate,omitempty"`
	Appfirewalllogsjsonxss                           int    `json:"appfirewalllogsjsonxss,omitempty"`
	Appfirewalllogsjsonxssrate                       int    `json:"appfirewalllogsjsonxssrate,omitempty"`
	Appfirewalllogsql                                int    `json:"appfirewalllogsql,omitempty"`
	Appfirewalllogsqlgram                            int    `json:"appfirewalllogsqlgram,omitempty"`
	Appfirewalllogsqlgramrate                        int    `json:"appfirewalllogsqlgramrate,omitempty"`
	Appfirewalllogsqlrate                            int    `json:"appfirewalllogsqlrate,omitempty"`
	Appfirewalllogstarturl                           int    `json:"appfirewalllogstarturl,omitempty"`
	Appfirewalllogstarturlrate                       int    `json:"appfirewalllogstarturlrate,omitempty"`
	Appfirewalllogtransformsql                       int    `json:"appfirewalllogtransformsql,omitempty"`
	Appfirewalllogtransformsqlrate                   int    `json:"appfirewalllogtransformsqlrate,omitempty"`
	Appfirewalllogtransformxss                       int    `json:"appfirewalllogtransformxss,omitempty"`
	Appfirewalllogtransformxssrate                   int    `json:"appfirewalllogtransformxssrate,omitempty"`
	Appfirewalllogxmlpayloadcontenttypemismatch      int    `json:"appfirewalllogxmlpayloadcontenttypemismatch,omitempty"`
	Appfirewalllogxmlpayloadcontenttypemismatchrate  int    `json:"appfirewalllogxmlpayloadcontenttypemismatchrate,omitempty"`
	Appfirewalllogxss                                int    `json:"appfirewalllogxss,omitempty"`
	Appfirewalllogxssrate                            int    `json:"appfirewalllogxssrate,omitempty"`
	Appfirewalllongavgresptime                       int    `json:"appfirewalllongavgresptime,omitempty"`
	Appfirewallmsgvallogs                            int    `json:"appfirewallmsgvallogs,omitempty"`
	Appfirewallmsgvallogsrate                        int    `json:"appfirewallmsgvallogsrate,omitempty"`
	Appfirewallpostbodylimitlogs                     int    `json:"appfirewallpostbodylimitlogs,omitempty"`
	Appfirewallpostbodylimitlogsrate                 int    `json:"appfirewallpostbodylimitlogsrate,omitempty"`
	Appfirewallpostbodylimitviolations               int    `json:"appfirewallpostbodylimitviolations,omitempty"`
	Appfirewallpostbodylimitviolationsrate           int    `json:"appfirewallpostbodylimitviolationsrate,omitempty"`
	Appfirewallredirects                             int    `json:"appfirewallredirects,omitempty"`
	Appfirewallredirectsrate                         int    `json:"appfirewallredirectsrate,omitempty"`
	Appfirewallreqbytes                              int    `json:"appfirewallreqbytes,omitempty"`
	Appfirewallreqbytesrate                          int    `json:"appfirewallreqbytesrate,omitempty"`
	Appfirewallrequests                              int    `json:"appfirewallrequests,omitempty"`
	Appfirewallrequestsrate                          int    `json:"appfirewallrequestsrate,omitempty"`
	Appfirewallresbytes                              int    `json:"appfirewallresbytes,omitempty"`
	Appfirewallresbytesrate                          int    `json:"appfirewallresbytesrate,omitempty"`
	Appfirewallresponses                             int    `json:"appfirewallresponses,omitempty"`
	Appfirewallresponsesrate                         int    `json:"appfirewallresponsesrate,omitempty"`
	Appfirewallret4xx                                int    `json:"appfirewallret4xx,omitempty"`
	Appfirewallret4xxrate                            int    `json:"appfirewallret4xxrate,omitempty"`
	Appfirewallret5xx                                int    `json:"appfirewallret5xx,omitempty"`
	Appfirewallret5xxrate                            int    `json:"appfirewallret5xxrate,omitempty"`
	Appfirewallshortavgresptime                      int    `json:"appfirewallshortavgresptime,omitempty"`
	Appfirewallsignaturelogs                         int    `json:"appfirewallsignaturelogs,omitempty"`
	Appfirewallsignaturelogsrate                     int    `json:"appfirewallsignaturelogsrate,omitempty"`
	Appfirewalltotallog                              int    `json:"appfirewalltotallog,omitempty"`
	Appfirewalltotalviol                             int    `json:"appfirewalltotalviol,omitempty"`
	Appfirewalltrapsdropped                          int    `json:"appfirewalltrapsdropped,omitempty"`
	Appfirewallviolbufferoverflow                    int    `json:"appfirewallviolbufferoverflow,omitempty"`
	Appfirewallviolbufferoverflowrate                int    `json:"appfirewallviolbufferoverflowrate,omitempty"`
	Appfirewallviolcmd                               int    `json:"appfirewallviolcmd,omitempty"`
	Appfirewallviolcmdrate                           int    `json:"appfirewallviolcmdrate,omitempty"`
	Appfirewallviolcontenttype                       int    `json:"appfirewallviolcontenttype,omitempty"`
	Appfirewallviolcontenttyperate                   int    `json:"appfirewallviolcontenttyperate,omitempty"`
	Appfirewallviolcookie                            int    `json:"appfirewallviolcookie,omitempty"`
	Appfirewallviolcookiehijack                      int    `json:"appfirewallviolcookiehijack,omitempty"`
	Appfirewallviolcookiehijackrate                  int    `json:"appfirewallviolcookiehijackrate,omitempty"`
	Appfirewallviolcookierate                        int    `json:"appfirewallviolcookierate,omitempty"`
	Appfirewallviolcreditcard                        int    `json:"appfirewallviolcreditcard,omitempty"`
	Appfirewallviolcreditcardrate                    int    `json:"appfirewallviolcreditcardrate,omitempty"`
	Appfirewallviolcsrftag                           int    `json:"appfirewallviolcsrftag,omitempty"`
	Appfirewallviolcsrftagrate                       int    `json:"appfirewallviolcsrftagrate,omitempty"`
	Appfirewallvioldenyurl                           int    `json:"appfirewallvioldenyurl,omitempty"`
	Appfirewallvioldenyurlrate                       int    `json:"appfirewallvioldenyurlrate,omitempty"`
	Appfirewallviolfieldconsistency                  int    `json:"appfirewallviolfieldconsistency,omitempty"`
	Appfirewallviolfieldconsistencyrate              int    `json:"appfirewallviolfieldconsistencyrate,omitempty"`
	Appfirewallviolfieldformat                       int    `json:"appfirewallviolfieldformat,omitempty"`
	Appfirewallviolfieldformatrate                   int    `json:"appfirewallviolfieldformatrate,omitempty"`
	Appfirewallviolfileuploadtypes                   int    `json:"appfirewallviolfileuploadtypes,omitempty"`
	Appfirewallviolfileuploadtypesrate               int    `json:"appfirewallviolfileuploadtypesrate,omitempty"`
	Appfirewallvioljsoncmd                           int    `json:"appfirewallvioljsoncmd,omitempty"`
	Appfirewallvioljsoncmdrate                       int    `json:"appfirewallvioljsoncmdrate,omitempty"`
	Appfirewallvioljsondos                           int    `json:"appfirewallvioljsondos,omitempty"`
	Appfirewallvioljsondosrate                       int    `json:"appfirewallvioljsondosrate,omitempty"`
	Appfirewallvioljsonsql                           int    `json:"appfirewallvioljsonsql,omitempty"`
	Appfirewallvioljsonsqlgram                       int    `json:"appfirewallvioljsonsqlgram,omitempty"`
	Appfirewallvioljsonsqlgramrate                   int    `json:"appfirewallvioljsonsqlgramrate,omitempty"`
	Appfirewallvioljsonsqlrate                       int    `json:"appfirewallvioljsonsqlrate,omitempty"`
	Appfirewallvioljsonxss                           int    `json:"appfirewallvioljsonxss,omitempty"`
	Appfirewallvioljsonxssrate                       int    `json:"appfirewallvioljsonxssrate,omitempty"`
	Appfirewallviolmsgvalviolations                  int    `json:"appfirewallviolmsgvalviolations,omitempty"`
	Appfirewallviolmsgvalviolationsrate              int    `json:"appfirewallviolmsgvalviolationsrate,omitempty"`
	Appfirewallviolrate                              int    `json:"appfirewallviolrate,omitempty"`
	Appfirewallviolrefererheader                     int    `json:"appfirewallviolrefererheader,omitempty"`
	Appfirewallviolrefererheaderrate                 int    `json:"appfirewallviolrefererheaderrate,omitempty"`
	Appfirewallviolsafeobject                        int    `json:"appfirewallviolsafeobject,omitempty"`
	Appfirewallviolsafeobjectrate                    int    `json:"appfirewallviolsafeobjectrate,omitempty"`
	Appfirewallviolsignature                         int    `json:"appfirewallviolsignature,omitempty"`
	Appfirewallviolsignaturerate                     int    `json:"appfirewallviolsignaturerate,omitempty"`
	Appfirewallviolsql                               int    `json:"appfirewallviolsql,omitempty"`
	Appfirewallviolsqlgram                           int    `json:"appfirewallviolsqlgram,omitempty"`
	Appfirewallviolsqlgramrate                       int    `json:"appfirewallviolsqlgramrate,omitempty"`
	Appfirewallviolsqlrate                           int    `json:"appfirewallviolsqlrate,omitempty"`
	Appfirewallviolstarturl                          int    `json:"appfirewallviolstarturl,omitempty"`
	Appfirewallviolstarturlrate                      int    `json:"appfirewallviolstarturlrate,omitempty"`
	Appfirewallviolwellformednessviolations          int    `json:"appfirewallviolwellformednessviolations,omitempty"`
	Appfirewallviolwellformednessviolationsrate      int    `json:"appfirewallviolwellformednessviolationsrate,omitempty"`
	Appfirewallviolwsiviolations                     int    `json:"appfirewallviolwsiviolations,omitempty"`
	Appfirewallviolwsiviolationsrate                 int    `json:"appfirewallviolwsiviolationsrate,omitempty"`
	Appfirewallviolxdosviolations                    int    `json:"appfirewallviolxdosviolations,omitempty"`
	Appfirewallviolxdosviolationsrate                int    `json:"appfirewallviolxdosviolationsrate,omitempty"`
	Appfirewallviolxmlattachmentviolations           int    `json:"appfirewallviolxmlattachmentviolations,omitempty"`
	Appfirewallviolxmlattachmentviolationsrate       int    `json:"appfirewallviolxmlattachmentviolationsrate,omitempty"`
	Appfirewallviolxmlgenviolations                  int    `json:"appfirewallviolxmlgenviolations,omitempty"`
	Appfirewallviolxmlgenviolationsrate              int    `json:"appfirewallviolxmlgenviolationsrate,omitempty"`
	Appfirewallviolxmlpayloadcontenttypemismatch     int    `json:"appfirewallviolxmlpayloadcontenttypemismatch,omitempty"`
	Appfirewallviolxmlpayloadcontenttypemismatchrate int    `json:"appfirewallviolxmlpayloadcontenttypemismatchrate,omitempty"`
	Appfirewallviolxmlsoapfaultviolations            int    `json:"appfirewallviolxmlsoapfaultviolations,omitempty"`
	Appfirewallviolxmlsoapfaultviolationsrate        int    `json:"appfirewallviolxmlsoapfaultviolationsrate,omitempty"`
	Appfirewallviolxmlsqlviolations                  int    `json:"appfirewallviolxmlsqlviolations,omitempty"`
	Appfirewallviolxmlsqlviolationsrate              int    `json:"appfirewallviolxmlsqlviolationsrate,omitempty"`
	Appfirewallviolxmlxssviolations                  int    `json:"appfirewallviolxmlxssviolations,omitempty"`
	Appfirewallviolxmlxssviolationsrate              int    `json:"appfirewallviolxmlxssviolationsrate,omitempty"`
	Appfirewallviolxss                               int    `json:"appfirewallviolxss,omitempty"`
	Appfirewallviolxssrate                           int    `json:"appfirewallviolxssrate,omitempty"`
	Appfirewallwellformednesslogs                    int    `json:"appfirewallwellformednesslogs,omitempty"`
	Appfirewallwellformednesslogsrate                int    `json:"appfirewallwellformednesslogsrate,omitempty"`
	Appfirewallwsilogs                               int    `json:"appfirewallwsilogs,omitempty"`
	Appfirewallwsilogsrate                           int    `json:"appfirewallwsilogsrate,omitempty"`
	Appfirewallxdoslogs                              int    `json:"appfirewallxdoslogs,omitempty"`
	Appfirewallxdoslogsrate                          int    `json:"appfirewallxdoslogsrate,omitempty"`
	Appfirewallxmlattachmentlogs                     int    `json:"appfirewallxmlattachmentlogs,omitempty"`
	Appfirewallxmlattachmentlogsrate                 int    `json:"appfirewallxmlattachmentlogsrate,omitempty"`
	Appfirewallxmlgenlogs                            int    `json:"appfirewallxmlgenlogs,omitempty"`
	Appfirewallxmlgenlogsrate                        int    `json:"appfirewallxmlgenlogsrate,omitempty"`
	Appfirewallxmlsoapfaultlogs                      int    `json:"appfirewallxmlsoapfaultlogs,omitempty"`
	Appfirewallxmlsoapfaultlogsrate                  int    `json:"appfirewallxmlsoapfaultlogsrate,omitempty"`
	Appfirewallxmlsqllogs                            int    `json:"appfirewallxmlsqllogs,omitempty"`
	Appfirewallxmlsqllogsrate                        int    `json:"appfirewallxmlsqllogsrate,omitempty"`
	Appfirewallxmlxsslogs                            int    `json:"appfirewallxmlxsslogs,omitempty"`
	Appfirewallxmlxsslogsrate                        int    `json:"appfirewallxmlxsslogsrate,omitempty"`
	Clearstats                                       string `json:"clearstats,omitempty"`
}

repository: chiradeep/go-nitro

repo_name: chiradeep/go-nitro

gha_language: Go


text:
@Article{kerschke2019automatedAS,
  Author    = {Kerschke, Pascal and Trautmann, Heike},
  Title     = {{Automated Algorithm Selection on Continuous Black-Box Problems By Combining Exploratory Landscape Analysis and Machine Learning}},
  Journal   = {{Evolutionary Computation (ECJ)}},
  Year      = {2019},
  Month     = {March},
  Volume    = {27},
  Issue     = {1},
  Pages     = {99~--~127},
  DOI       = {10.1162/evco_a_00236},
  URL       = {https://www.mitpressjournals.org/doi/abs/10.1162/evco_a_00236},
  Publisher = {{MIT Press}}
}

gha_language: HTML


text:
DESCRIPTION = "QT EGLFS for ${MACHINE}"
SECTION = "base"
PRIORITY = "required"
LICENSE = "CLOSED"
PACKAGE_ARCH = "${MACHINE_ARCH}"

COMPATIBLE_MACHINE = "hd51|vs1500|bre2ze4k"

PR = "r1"

QEGLFS = "qt5/plugins/egldeviceintegrations"

SRC_URI = "file://libqeglfs-nxpl-integration.so"

SRC_URI[md5sum] = "10d17175af9fe9f7d79a15c3da1ea830"
SRC_URI[sha256sum] = "3672ae49c8e19a5e6f552851acb0d54376b9c445be2c92808b2c4b2274c86678"

S = "${WORKDIR}"

INHIBIT_PACKAGE_STRIP = "1"

do_compile() {
}

do_install() {
	install -d ${D}${libdir}/${QEGLFS}
	install -m 0755 libqeglfs-nxpl-integration.so ${D}${libdir}/${QEGLFS}/
}

do_package_qa() {
}

FILES_${PN} = "/usr/lib/qt5/plugins/egldeviceintegrations/libqeglfs-nxpl-integration.so"

INSANE_SKIP_${PN} += "already-stripped dev-so"

extension: bb


text:
package main

type DepPkg struct {
	Name     string `toml:"name"`
	Version  string `toml:"version,omitempty"`
	Branch   string `toml:"branch,omitempty"`
	Source   string `toml:"source,omitempty"`
	Revision string `toml:"revision,omitempty"`
}

type Dep struct {
	Constraint []DepPkg `toml:"constraint"`
	Override   []DepPkg `toml:"override"`
	Prune      struct {
		UnusedPackages bool `toml:"unused-packages"`
		GoTests        bool `toml:"go-tests"`
	} `toml:"prune"`
}

repository: appscodelabs/gomod-tools

repo_name: appscodelabs/gomod-tools


text:
@article{Pasquier2022,
  doi = {10.21105/joss.03814},
  url = {https://doi.org/10.21105/joss.03814},
  year = {2022},
  publisher = {The Open Journal},
  volume = {7},
  number = {69},
  pages = {3814},
  author = {Benoît Pasquier and François W. Primeau and Seth G. John},
  title = {AIBECS.jl: A tool for exploring global marine biogeochemical cycles.},
  journal = {Journal of Open Source Software}
}

repository: briochemc/academic-kickstart

repo_name: briochemc/academic-kickstart


text:
@article{Jiao_2005_apr,
 author = {Yuling Jiao and Peixin Jia and Xiangfeng Wang and Ning Su and Shuliang Yu and Dongfen Zhang and Ligeng Ma and Qi Feng and Zhaoqing Jin and Lei Li and Yongbiao Xue and Zhukuan Cheng and Hongyu Zhao and Bin Han and Xing Wang Deng},
 doi = {10.1105/tpc.105.031575},
 journal = {The Plant Cell},
 month = {apr},
 number = {6},
 pages = {1641--1657},
 publisher = {Oxford University Press (OUP)},
 title = {A Tiling Microarray Expression Analysis of Rice Chromosome 4 Suggests a Chromosome-Level Regulation of Transcription},
 url = {https://doi.org/10.1105%2Ftpc.105.031575},
 volume = {17},
 year = {2005}
}

repository: wanglab-cau/CrazyHsu

repo_name: wanglab-cau/CrazyHsu

branch_name: refs/heads/main


text:
DESCRIPTION = "Simple tools for encoding/decoding MIME messages"
SECTION = "utils"
DEPENDS = ""
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://README.unix;md5=051b99a33e90ff77ef0c8992a02fd660"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"

SRC_URI = "http://ftp.andrew.cmu.edu/pub/mpack/mpack-${PV}.tar.gz"

SRC_URI[md5sum] = "a70fa5afa76539a9afb70b9d81568fe8"
SRC_URI[sha256sum] = "274108bb3a39982a4efc14fb3a65298e66c8e71367c3dabf49338162d207a94c"

# Make sure our source directory (for the build) matches the directory
# structure in the tarball
S = "${WORKDIR}/mpack-${PV}"

inherit autotools

# The autotools configuration I am basing this on seems to have a problem with a race condition when parallel make is enabled
PARALLEL_MAKE = ""

# Force C99 in order to prevent implicit declaration of built-in functions
CFLAGS_append = " -std=c99"


text:
/*
 *  Copyright (c) 2009, Rene Wagner
 *  Copyright (c) 2010, 2011 DFKI GmbH
 *  All rights reserved.
 *
 *  Author: Rene Wagner <rene.wagner@dfki.de>
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above
 *     copyright notice, this list of conditions and the following
 *     disclaimer in the documentation and/or other materials provided
 *     with the distribution.
 *   * Neither the name of the DFKI GmbH nor the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 *  POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef __UKFOM_UKF_HPP__
#define __UKFOM_UKF_HPP__

#include <vector>
#include <algorithm>
#include <numeric>

#include <boost/bind.hpp>

#include <Eigen/Core>
#include <Eigen/LU>
#include <Eigen/Eigenvalues>

#include <Eigen/QR>

#include "lapack/cholesky.hpp"
#include "traits/dof.hpp"
#include "util.hpp"

namespace ukfom {

// import most common Eigen types
using namespace Eigen;

template <typename state>
class ukf {
	typedef ukf self;

	enum {
		n = state::DOF
	};

public:

	typedef typename state::scalar_type scalar_type;
	typedef typename state::vectorized_type vectorized_state;
	typedef Matrix<scalar_type, int(state::DOF), int(state::DOF)> cov;
	typedef std::vector<state> state_vector;

	ukf(const state &mu,
		const cov &sigma)
		: mu_(mu),
		  sigma_(sigma)
	{
	}

	template<typename ProcessModel>
	void predict(ProcessModel g, const cov &R)
	{
		predict(g, boost::bind(id<cov>, R));
	}

	template<typename ProcessModel, typename ProcessNoiseCovariance>
	void predict(ProcessModel g, ProcessNoiseCovariance R)
	{
		state_vector X(2 * n + 1);
		generate_sigma_points(mu_, sigma_, X);

		std::transform(X.begin(), X.end(), X.begin(), g);

		mu_ = sigma_points_mean(X);

		//std::cout << "mu':" << std::endl << mu_ << std::endl;

		sigma_ = sigma_points_cov<state::DOF>(mu_, X) + R();
	}

	template<typename Measurement,
			 typename MeasurementModel,
			 typename MeasurementNoiseCovariance>
	void update(const Measurement &z,
				MeasurementModel h,
				MeasurementNoiseCovariance Q)
	{
		update(z, h, Q,
			   accept_any_mahalanobis_distance<scalar_type>);
	}

	template<typename Measurement,
			 typename MeasurementModel>
	void update(const Measurement &z,
				MeasurementModel h,
				const Eigen::Matrix<scalar_type, dof<Measurement>::value, dof<Measurement>::value> &Q)
	{
		typedef Eigen::Matrix<scalar_type, dof<Measurement>::value, dof<Measurement>::value> measurement_cov;
		update(z, h,
			   boost::bind(id<measurement_cov>, Q),
			   accept_any_mahalanobis_distance<scalar_type>);
	}

	template<typename Measurement,
			 typename MeasurementModel,
			 typename MeasurementNoiseCovariance,
			 typename MahalanobisTest>
	void update(const Measurement &z,
				MeasurementModel h,
				MeasurementNoiseCovariance Q,
				MahalanobisTest mt)
	{
		const static int measurement_rows = dof<Measurement>::value;
		typedef Measurement measurement;
		typedef Eigen::Matrix<scalar_type, measurement_rows, 1> vectorized_measurement;
		typedef Matrix<scalar_type, measurement_rows, measurement_rows> measurement_cov;
		typedef Matrix<scalar_type, state::DOF, measurement_rows> cross_cov;

		state_vector X(2 * n + 1);
		generate_sigma_points(mu_, sigma_, X);

		std::vector<measurement> Z(X.size());
		std::transform(X.begin(), X.end(), Z.begin(), h);

		const measurement meanZ = sigma_points_mean(Z);
		const measurement_cov S = sigma_points_cov<measurement_rows>(meanZ, Z) + Q();
		const cross_cov covXZ = sigma_points_cross_cov<measurement_rows>(mu_, meanZ, X, Z);

		measurement_cov S_inverse(S.inverse());

		const cross_cov K = covXZ * S_inverse;

		const vectorized_measurement innovation = z - meanZ;

		const scalar_type mahalanobis2 = (innovation.transpose() * S_inverse * innovation)(0);

		if (mt(mahalanobis2))
		{
			sigma_ -= K * S * K.transpose();
			apply_delta(K * innovation);
		}
	}

	const state &mu() const
	{
		return mu_;
	}

	const cov &sigma() const
	{
		return sigma_;
	}

private:

	void generate_sigma_points(const state &mu,
							   const vectorized_state &delta,
							   const cov &sigma,
							   state_vector &X) const
	{
		assert(X.size() == 2 * n + 1);

		MatrixXd L(sigma.llt().matrixL());

		/*if (!L.isSPD())
		{
			std::cerr << std::endl << "sigma is not SPD:" << std::endl
					  << sigma << std::endl
					  << "---" << std::endl;
			Eigen::EigenSolver<cov> eig(sigma);
			std::cerr << "eigen values: " << eig.eigenvalues().transpose() << std::endl;
		}

		assert(L.isSPD());*/

		/*
		std::cout << ">> L" << std::endl
				  << L.getL() << std::endl
				  << "<< L" << std::endl;
		*/

		X[0] = mu + delta;
		for (std::size_t i = 1, j = 0; j < n; ++j)
		{
			//std::cout << "L.col(" << j << "): " << L.getL().col(j).transpose() << std::endl;
			X[i++] = mu + (delta + L.col(j));
			X[i++] = mu + (delta - L.col(j));
		}
		//print_sigma_points(X);
	}

	void generate_sigma_points(const state &mu,
							   const cov &sigma,
							   state_vector &X) const
	{
		generate_sigma_points(mu, vectorized_state::Zero(), sigma, X);
	}

	// manifold mean
	template<typename manifold>
	manifold
	sigma_points_mean(const std::vector<manifold> &X) const
	{
		manifold reference = X[0];
		typename manifold::vectorized_type mean_delta;
		const static std::size_t max_it = 10000;

		std::size_t i = 0;
		do {
			mean_delta.setZero();
			for (typename std::vector<manifold>::const_iterator Xi = X.begin(); Xi != X.end(); ++Xi)
			{
				mean_delta += *Xi - reference;
			}
			mean_delta /= X.size();
			reference += mean_delta;
		} while (mean_delta.norm() > 1e-6
				 && ++i < max_it);

		if (i >= max_it)
		{
			std::cerr << "ERROR: sigma_points_mean() did not converge. norm(mean_delta)=" << mean_delta.norm() << std::endl;
			assert(false);
		}

		return reference;
	}

	// vector mean
	template<int measurement_rows>
	Matrix<scalar_type, measurement_rows, 1>
	sigma_points_mean(const std::vector<Matrix<scalar_type, measurement_rows, 1> > &Z) const
	{
		typedef Matrix<scalar_type, measurement_rows, 1> measurement;

		return std::accumulate(Z.begin(), Z.end(), measurement(measurement::Zero())) / Z.size();
	}

#ifdef VECT_H_
	// MTK vector mean
	template<int measurement_rows>
	MTK::vect<measurement_rows, scalar_type>
	sigma_points_mean(const std::vector<MTK::vect<measurement_rows, scalar_type> > &Z) const
	{
		typedef MTK::vect<measurement_rows, scalar_type> measurement;

		return std::accumulate(Z.begin(), Z.end(), measurement(measurement::Zero())) / Z.size();
	}
#endif // VECT_H_

	template<int cov_size, typename T>
	Matrix<scalar_type, -1, -1>
	sigma_points_cov(const T &mean, const std::vector<T> &V) const
	{
		typedef Matrix<scalar_type, -1, -1> cov_mat;
		typedef Matrix<scalar_type, cov_size, 1> cov_col;

		cov_mat c(cov_mat::Zero(cov_size,cov_size));

		for (typename std::vector<T>::const_iterator Vi = V.begin(); Vi != V.end(); ++Vi)
		{
			cov_col d = *Vi - mean;
			c += d * d.transpose();
		}

		return 0.5 * c;
	}

	template<int measurement_rows, typename Measurement>
	Matrix<scalar_type, state::DOF, measurement_rows>
	sigma_points_cross_cov(const state &meanX,
						   const Measurement &meanZ,
						   const state_vector &X,
						   const std::vector<Measurement> &Z) const
	{
		assert(X.size() == Z.size());

		typedef Matrix<scalar_type, state::DOF, measurement_rows> cross_cov;

		cross_cov c(cross_cov::Zero());

		{
			typename state_vector::const_iterator Xi = X.begin();
			typename std::vector<Measurement>::const_iterator Zi = Z.begin();
			for (;Zi != Z.end(); ++Xi, ++Zi)
			{
				c += (*Xi - meanX) * (*Zi - meanZ).transpose();
			}
		}

		return 0.5 * c;
	}

	void apply_delta(const vectorized_state &delta)
	{
		state_vector X(2 * n + 1);
		generate_sigma_points(mu_, delta, sigma_, X);

		mu_ = sigma_points_mean(X);
		sigma_ = sigma_points_cov<state::DOF>(mu_, X);
	}

public: state mu_;
public: cov sigma_;

	// for debugging only

	void print_sigma_points(const state_vector &X) const
	{
		std::cout << "generated sigma points:" << std::endl;
		for (typename state_vector::const_iterator Xi = X.begin(); Xi != X.end(); ++Xi)
		{
			std::cout << *Xi << std::endl << "***" << std::endl;
		}
	}

public:
	void check_sigma_points()
    {
		state_vector X(2 * n + 1);
		generate_sigma_points(mu_, sigma_, X);

		state muX = sigma_points_mean(X);

		cov sigma_test = sigma_points_cov<state::DOF>(muX, X);
		if((sigma_test - sigma_).cwise().abs().maxCoeff()>1e-6){
			std::cerr << sigma_test << "\n\n" << sigma_;
			assert(false);
		}

		if (mu_ != muX)
		{
//			std::cout << "mu_:" << mu_ << std::endl;
//			std::cout << "muX:" << muX << std::endl;
			std::cout << "norm:" << ((mu_ - muX).norm() > 0. ? ">" : "=") << std::endl;
		}
		assert (mu_ == muX);
	}

public:
	EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};

} // namespace ukfom
#endif // __UKFOM_UKF_HPP__

repository: dongyanchaoTJ/ADEKF

repo_name: dongyanchaoTJ/ADEKF

extension: hpp


text:
require bug-app.inc

DESCRIPTION = "I wrote this application in response to a users question on the forums: \
http://bugcommunity.com/forums/viewtopic.php?t=324 \
Andrew wanted to step outside the monolithic nature of OSGi, in that your application bundle is automatically started when your required resources become available.  In this application, I do some headless stuff (print the date to the console) and if I get an LCD Module (or the IModuleDisplay service), I print the date to the LCD module.  \
This is handy if I want an application that doesn't necessarily require a GUI, but if there's an LCD module, can use it if it likes..  In fact, I think I'm going to modify the TweetNTwitch app to just this for login credentials.\
\
--------------------------------------\
Please feel free to email me at john [at] buglabs.net for information. Or check out BUGLabs on IRC: irc://irc.freenode.net/buglabs ."
HOMEPAGE = "http://buglabs.net/applications/PickAndChooseServicesApp"

DEPENDS += "com.buglabs.bug.base com.buglabs.osgi com.buglabs.common service-tracker com.buglabs.bug.module.lcd "

PV = "1"

SRC_LINK = "http://buglabs.net/program_version/download/224"

APIVERSION = ""

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
/*
 * Copyright 2020 The Knative Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package framework

import (
	"testing"

	"knative.dev/reconciler-test/pkg/config"
)

// Suite represents a collection of test cases.
// Must be instantiated in TestMain.
type Suite interface {
	// Configure assembles the suite configuration by
	// - reading the configuration file in the test directory, up to the root project
	// - overriding config values with the one provided on the command line
	//
	// Not calling this function is equivalent to calling it with BaseConfig.
	Configure(def config.Config) Suite

	// Require indicates the given component is needed to
	// run test cases.
	Require(component Component) Suite

	// Run runs the tests
	Run()
}

// NewSuite creates a new test suite
func NewSuite(m *testing.M) Suite {
	return newSuite(m)
}

repository: tommyreddad/reconciler-test

repo_name: tommyreddad/reconciler-test


text:
package emissione

// WriterOptions is the option-wrapper for defining the workings of a Writer.
type WriterOptions struct {
	MarshallMethod func(v interface{}) ([]byte, error)
	ContentType    string
}

// WriterOption is functional option to WriterOptions.
type WriterOption func(*WriterOptions)

// MarshallMethod defines the marshalling method used by a SimpleWriter
// to marshall output objects.
func MarshallMethod(method func(v interface{}) ([]byte, error)) WriterOption {
	return func(args *WriterOptions) {
		args.MarshallMethod = method
	}
}

// ContentType sets the content-type string, which will be set as the header
// of the same name.
func ContentType(contentType string) WriterOption {
	return func(args *WriterOptions) {
		args.ContentType = contentType
	}
}


text:
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/

%% Created for Adrian Price-Whelan at 2016-09-08 21:38:30 -0400

%% Saved with string encoding Unicode (UTF-8)

@article{Foreman-Mackey:2013,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2013PASP..125..306F},
	Archiveprefix = {arXiv},
	Author = {{Foreman-Mackey}, D. and {Hogg}, D.~W. and {Lang}, D. and {Goodman}, J.},
	Date-Added = {2016-09-09 01:37:58 +0000},
	Date-Modified = {2016-09-09 01:38:30 +0000},
	Doi = {10.1086/670067},
	Eprint = {1202.3665},
	Journal = {\pasp},
	Month = mar,
	Pages = {306-312},
	Primaryclass = {astro-ph.IM},
	Title = {{emcee: The MCMC Hammer}},
	Volume = 125,
	Year = 2013,
	Bdsk-Url-1 = {http://dx.doi.org/10.1086/670067}}

@misc{Foreman-Mackey:2013ascl,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2013ascl.soft03002F},
	Archiveprefix = {ascl},
	Author = {{Foreman-Mackey}, D. and {Conley}, A. and {Meierjurgen Farr}, W. and {Hogg}, D.~W. and {Long}, D. and {Marshall}, P. and {Price-Whelan}, A. and {Sanders}, J. and {Zuntz}, J.},
	Date-Added = {2016-09-09 01:37:34 +0000},
	Date-Modified = {2016-09-09 01:38:21 +0000},
	Eprint = {1303.002},
	Howpublished = {Astrophysics Source Code Library},
	Keywords = {Software},
	Month = mar,
	Title = {{emcee: The MCMC Hammer}},
	Year = 2013}

@article{Hunter:2007,
	Abstract = {Matplotlib is a 2D graphics package used for Python
  for application development, interactive scripting, and
  publication-quality image generation across user
  interfaces and operating systems.},
	Author = {Hunter, J. D.},
	Date-Added = {2016-09-09 01:36:14 +0000},
	Date-Modified = {2016-09-09 01:36:14 +0000},
	Journal = {Computing In Science \& Engineering},
	Number = {3},
	Pages = {90--95},
	Publisher = {IEEE COMPUTER SOC},
	Title = {Matplotlib: A 2D graphics environment},
	Volume = {9},
	Year = 2007}

@article{Perez:2007,
	Author = {P\'erez, Fernando and Granger, Brian E.},
	Date-Added = {2016-09-09 01:35:47 +0000},
	Date-Modified = {2016-09-09 01:35:52 +0000},
	Doi = {10.1109/MCSE.2007.53},
	Issn = {1521-9615},
	Journal = {Computing in Science and Engineering},
	Month = may,
	Number = {3},
	Pages = {21--29},
	Publisher = {IEEE Computer Society},
	Title = {{IP}ython: a System for Interactive Scientific Computing},
	Url = {http://ipython.org},
	Volume = {9},
	Year = 2007,
	Bdsk-Url-1 = {http://ipython.org},
	Bdsk-Url-2 = {http://dx.doi.org/10.1109/MCSE.2007.53}}

@article{Astropy-Collaboration:2013,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2013A%26A...558A..33A},
	Archiveprefix = {arXiv},
	Author = {{Astropy Collaboration} and {Robitaille}, T.~P. and {Tollerud}, E.~J. and {Greenfield}, P. and {Droettboom}, M. and {Bray}, E. and {Aldcroft}, T. and {Davis}, M. and {Ginsburg}, A. and {Price-Whelan}, A.~M. and {Kerzendorf}, W.~E. and {Conley}, A. and {Crighton}, N. and {Barbary}, K. and {Muna}, D. and {Ferguson}, H. and {Grollier}, F. and {Parikh}, M.~M. and {Nair}, P.~H. and {Unther}, H.~M. and {Deil}, C. and {Woillez}, J. and {Conseil}, S. and {Kramer}, R. and {Turner}, J.~E.~H. and {Singer}, L. and {Fox}, R. and {Weaver}, B.~A. and {Zabalza}, V. and {Edwards}, Z.~I. and {Azalee Bostroem}, K. and {Burke}, D.~J. and {Casey}, A.~R. and {Crawford}, S.~M. and {Dencheva}, N. and {Ely}, J. and {Jenness}, T. and {Labrie}, K. and {Lim}, P.~L. and {Pierfederici}, F. and {Pontzen}, A. and {Ptak}, A. and {Refsdal}, B. and {Servillat}, M. and {Streicher}, O.},
	Date-Added = {2016-09-09 01:34:49 +0000},
	Date-Modified = {2016-09-09 01:34:49 +0000},
	Doi = {10.1051/0004-6361/201322068},
	Eid = {A33},
	Eprint = {1307.6212},
	Journal = {\aap},
	Keywords = {methods: data analysis, methods: miscellaneous, virtual observatory tools},
	Month = oct,
	Pages = {A33},
	Primaryclass = {astro-ph.IM},
	Title = {{Astropy: A community Python package for astronomy}},
	Volume = 558,
	Year = 2013,
	Bdsk-Url-1 = {http://dx.doi.org/10.1051/0004-6361/201322068}}

@article{Nidever:2015,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2015AJ....150..173N},
	Archiveprefix = {arXiv},
	Author = {{Nidever}, D.~L. and {Holtzman}, J.~A. and {Allende Prieto}, C. and {Beland}, S. and {Bender}, C. and {Bizyaev}, D. and {Burton}, A. and {Desphande}, R. and {Fleming}, S.~W. and {Garc{\'{\i}}a P{\'e}rez}, A.~E. and {Hearty}, F.~R. and {Majewski}, S.~R. and {M{\'e}sz{\'a}ros}, S. and {Muna}, D. and {Nguyen}, D. and {Schiavon}, R.~P. and {Shetrone}, M. and {Skrutskie}, M.~F. and {Sobeck}, J.~S. and {Wilson}, J.~C.},
	Date-Added = {2016-09-08 23:58:02 +0000},
	Date-Modified = {2016-09-08 23:58:06 +0000},
	Doi = {10.1088/0004-6256/150/6/173},
	Eid = {173},
	Eprint = {1501.03742},
	Journal = {\aj},
	Keywords = {galaxies: abundances, galaxies: halos, galaxies: kinematics and dynamics, Local Group, methods: data analysis, techniques: image processing},
	Month = dec,
	Pages = {173},
	Primaryclass = {astro-ph.IM},
	Title = {{The Data Reduction Pipeline for the Apache Point Observatory Galactic Evolution Experiment}},
	Volume = 150,
	Year = 2015,
	Bdsk-Url-1 = {http://dx.doi.org/10.1088/0004-6256/150/6/173}}

@article{SDSS-Collaboration:2016,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2016arXiv160802013S},
	Archiveprefix = {arXiv},
	Author = {{SDSS Collaboration} and {Albareti}, F.~D. and {Allende Prieto}, C. and {Almeida}, A. and {Anders}, F. and {Anderson}, S. and {Andrews}, B.~H. and {Aragon-Salamanca}, A. and {Argudo-Fernandez}, M. and {Armengaud}, E. and et al.},
	Date-Added = {2016-09-08 23:49:27 +0000},
	Date-Modified = {2016-09-08 23:49:34 +0000},
	Eprint = {1608.02013},
	Journal = {ArXiv e-prints},
	Keywords = {Astrophysics - Astrophysics of Galaxies},
	Month = aug,
	Title = {{The Thirteenth Data Release of the Sloan Digital Sky Survey: First Spectroscopic Data from the SDSS-IV Survey MApping Nearby Galaxies at Apache Point Observatory}},
	Year = 2016}

@article{Van-der-Walt:2011,
	Author = {{Van der Walt}, {Stefan} and Colbert, S. Chris and Varoquaux, Gael},
	Date-Added = {2016-09-08 15:26:29 +0000},
	Date-Modified = {2016-09-09 01:32:29 +0000},
	Doi = {http://dx.doi.org/10.1109/MCSE.2011.37},
	Journal = {{Computing in Science \& Engineering}},
	Number = {2},
	Pages = {22-30},
	Title = {The NumPy Array: A Structure for Efficient Numerical Computation},
	Url = {http://scitation.aip.org/content/aip/journal/cise/13/2/10.1109/MCSE.2011.37},
	Volume = {13},
	Year = {2011},
	Bdsk-Url-1 = {http://scitation.aip.org/content/aip/journal/cise/13/2/10.1109/MCSE.2011.37},
	Bdsk-Url-2 = {http://dx.doi.org/10.1109/MCSE.2011.37}}

@article{Towns:2014,
	Address = {Los Alamitos, CA, USA},
	Author = {John Towns and Timothy Cockerill and Maytal Dahan and Ian Foster and Kelly Gaither and Andrew Grimshaw and Victor Hazlewood and Scott Lathrop and Dave Lifka and Gregory D. Peterson and Ralph Roskies and J. Ray Scott and Nancy Wilkens-Diehr},
	Date-Added = {2016-09-08 15:23:04 +0000},
	Date-Modified = {2016-09-08 15:23:04 +0000},
	Doi = {http://doi.ieeecomputersociety.org/10.1109/MCSE.2014.80},
	Issn = {1521-9615},
	Journal = {Computing in Science and Engineering},
	Number = {5},
	Pages = {62-74},
	Publisher = {IEEE Computer Society},
	Title = {XSEDE: Accelerating Scientific Discovery},
	Volume = {16},
	Year = {2014},
	Bdsk-Url-1 = {http://doi.ieeecomputersociety.org/10.1109/MCSE.2014.80}}

@inbook{Murray:2010,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2010exop.book...15M},
	Author = {{Murray}, C.~D. and {Correia}, A.~C.~M.},
	Booktitle = {Exoplanets},
	Date-Added = {2016-09-04 18:46:39 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Editor = {{Seager}, S.},
	Month = dec,
	Pages = {15-23},
	Title = {{Keplerian Orbits and Dynamics of Exoplanets}},
	Year = 2010}

@article{Troup:2016,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2016AJ....151...85T},
	Archiveprefix = {arXiv},
	Author = {{Troup}, N.~W. and {Nidever}, D.~L. and {De Lee}, N. and {Carlberg}, J. and {Majewski}, S.~R. and {Fernandez}, M. and {Covey}, K. and {Chojnowski}, S.~D. and {Pepper}, J. and {Nguyen}, D.~T. and {Stassun}, K. and {Nguyen}, D.~C. and {Wisniewski}, J.~P. and {Fleming}, S.~W. and {Bizyaev}, D. and {Frinchaboy}, P.~M. and {Garc{\'{\i}}a-Hern{\'a}ndez}, D.~A. and {Ge}, J. and {Hearty}, F. and {Meszaros}, S. and {Pan}, K. and {Allende Prieto}, C. and {Schneider}, D.~P. and {Shetrone}, M.~D. and {Skrutskie}, M.~F. and {Wilson}, J. and {Zamora}, O.},
	Date-Added = {2016-09-04 18:45:53 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Doi = {10.3847/0004-6256/151/3/85},
	Eid = {85},
	Eprint = {1601.00688},
	Journal = {\aj},
	Keywords = {binaries: close, binaries: spectroscopic, brown dwarfs, Galaxy: stellar content, planetary systems},
	Month = mar,
	Pages = {85},
	Primaryclass = {astro-ph.SR},
	Title = {{Companions to APOGEE Stars. I. A Milky Way-spanning Catalog of Stellar and Substellar Companion Candidates and Their Diverse Hosts}},
	Volume = 151,
	Year = 2016,
	Bdsk-Url-1 = {http://dx.doi.org/10.3847/0004-6256/151/3/85}}

@article{Majewski:2015,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2015arXiv150905420M},
	Archiveprefix = {arXiv},
	Author = {{Majewski}, S.~R. and {Schiavon}, R.~P. and {Frinchaboy}, P.~M. and {Allende Prieto}, C. and {Barkhouser}, R. and {Bizyaev}, D. and {Blank}, B. and {Brunner}, S. and {Burton}, A. and {Carrera}, R. and {Chojnowski}, S.~D. and {Cunha}, K. and {Epstein}, C. and {Fitzgerald}, G. and {Garcia Perez}, A.~E. and {Hearty}, F.~R. and {Henderson}, C. and {Holtzman}, J.~A. and {Johnson}, J.~A. and {Lam}, C.~R. and {Lawler}, J.~E. and {Maseman}, P. and {Meszaros}, S. and {Nelson}, M. and {Coung Nguyen}, D. and {Nidever}, D.~L. and {Pinsonneault}, M. and {Shetrone}, M. and {Smee}, S. and {Smith}, V.~V. and {Stolberg}, T. and {Skrutskie}, M.~F. and {Walker}, E. and {Wilson}, J.~C. and {Zasowski}, G. and {Anders}, F. and {Basu}, S. and {Beland}, S. and {Blanton}, M.~R. and {Bovy}, J. and {Brownstein}, J.~R. and {Carlberg}, J. and {Chaplin}, W. and {Chiappini}, C. and {Eisenstein}, D.~J. and {Elsworth}, Y. and {Feuillet}, D. and {Fleming}, S.~W. and {Galbraith-Frew}, J. and {Garcia}, R.~A. and {Anibal Garcia-Hernandez}, D. and {Gillespie}, B.~A. and {Girardi}, L. and {Gunn}, J.~E. and {Hasselquist}, S. and {Hayden}, M.~R. and {Hekker}, S. and {Ivans}, I. and {Kinemuchi}, K. and {Klaene}, M. and {Mahadevan}, S. and {Mathur}, S. and {Mosser}, B. and {Muna}, D. and {Munn}, J.~A. and {Nichol}, R.~C. and {O'Connell}, R.~W. and {Robin}, A.~C. and {Rocha-Pinto}, H. and {Schultheis}, M. and {Serenelli}, A.~M. and {Shane}, N. and {Silva Aguirre}, V. and {Sobeck}, J.~S. and {Thompson}, B. and {Troup}, N.~W. and {Weinberg}, D.~H. and {Zamora}, O.},
	Date-Added = {2016-09-04 18:45:32 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Eprint = {1509.05420},
	Journal = {ArXiv e-prints},
	Keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Astrophysics of Galaxies},
	Month = sep,
	Primaryclass = {astro-ph.IM},
	Title = {{The Apache Point Observatory Galactic Evolution Experiment (APOGEE)}},
	Year = 2015}

@article{Kipping:2013,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2013MNRAS.434L..51K},
	Archiveprefix = {arXiv},
	Author = {{Kipping}, D.~M.},
	Date-Added = {2016-09-04 18:45:03 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Doi = {10.1093/mnrasl/slt075},
	Eprint = {1306.4982},
	Journal = {\mnras},
	Keywords = {methods: statistical, planets and satellites: general},
	Month = jul,
	Pages = {L51-L55},
	Primaryclass = {astro-ph.EP},
	Title = {{Parametrizing the exoplanet eccentricity distribution with the Beta distribution}},
	Volume = 434,
	Year = 2013,
	Bdsk-Url-1 = {http://dx.doi.org/10.1093/mnrasl/slt075}}

@article{Holtzman:2015,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2015AJ....150..148H},
	Archiveprefix = {arXiv},
	Author = {{Holtzman}, J.~A. and {Shetrone}, M. and {Johnson}, J.~A. and {Allende Prieto}, C. and {Anders}, F. and {Andrews}, B. and {Beers}, T.~C. and {Bizyaev}, D. and {Blanton}, M.~R. and {Bovy}, J. and {Carrera}, R. and {Chojnowski}, S.~D. and {Cunha}, K. and {Eisenstein}, D.~J. and {Feuillet}, D. and {Frinchaboy}, P.~M. and {Galbraith-Frew}, J. and {Garc{\'{\i}}a P{\'e}rez}, A.~E. and {Garc{\'{\i}}a-Hern{\'a}ndez}, D.~A. and {Hasselquist}, S. and {Hayden}, M.~R. and {Hearty}, F.~R. and {Ivans}, I. and {Majewski}, S.~R. and {Martell}, S. and {Meszaros}, S. and {Muna}, D. and {Nidever}, D. and {Nguyen}, D.~C. and {O'Connell}, R.~W. and {Pan}, K. and {Pinsonneault}, M. and {Robin}, A.~C. and {Schiavon}, R.~P. and {Shane}, N. and {Sobeck}, J. and {Smith}, V.~V. and {Troup}, N. and {Weinberg}, D.~H. and {Wilson}, J.~C. and {Wood-Vasey}, W.~M. and {Zamora}, O. and {Zasowski}, G.},
	Date-Added = {2016-09-04 18:44:13 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Doi = {10.1088/0004-6256/150/5/148},
	Eid = {148},
	Eprint = {1501.04110},
	Journal = {\aj},
	Keywords = {astronomical databases: miscellaneous, Galaxy: abundances, stars: abundances, surveys},
	Month = nov,
	Pages = {148},
	Title = {{Abundances, Stellar Parameters, and Spectra from the SDSS-III/APOGEE Survey}},
	Volume = 150,
	Year = 2015,
	Bdsk-Url-1 = {http://dx.doi.org/10.1088/0004-6256/150/5/148}}

@article{Eisenstein:2011,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2011AJ....142...72E},
	Archiveprefix = {arXiv},
	Author = {{Eisenstein}, D.~J. and {Weinberg}, D.~H. and {Agol}, E. and {Aihara}, H. and {Allende Prieto}, C. and {Anderson}, S.~F. and {Arns}, J.~A. and {Aubourg}, {\'E}. and {Bailey}, S. and {Balbinot}, E. and et al.},
	Date-Added = {2016-09-04 18:43:46 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Doi = {10.1088/0004-6256/142/3/72},
	Eid = {72},
	Eprint = {1101.1529},
	Journal = {\aj},
	Keywords = {cosmology: observations, Galaxy: evolution, planets and satellites: detection, surveys},
	Month = sep,
	Pages = {72},
	Primaryclass = {astro-ph.IM},
	Title = {{SDSS-III: Massive Spectroscopic Surveys of the Distant Universe, the Milky Way, and Extra-Solar Planetary Systems}},
	Volume = 142,
	Year = 2011,
	Bdsk-Url-1 = {http://dx.doi.org/10.1088/0004-6256/142/3/72}}

@article{Alam:2015,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/2015ApJS..219...12A},
	Archiveprefix = {arXiv},
	Author = {{Alam}, S. and {Albareti}, F.~D. and {Allende Prieto}, C. and {Anders}, F. and {Anderson}, S.~F. and {Anderton}, T. and {Andrews}, B.~H. and {Armengaud}, E. and {Aubourg}, {\'E}. and {Bailey}, S. and et al.},
	Date-Added = {2016-09-04 18:43:15 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Doi = {10.1088/0067-0049/219/1/12},
	Eid = {12},
	Eprint = {1501.00963},
	Journal = {\apjs},
	Keywords = {atlases, catalogs, surveys},
	Month = jul,
	Pages = {12},
	Primaryclass = {astro-ph.IM},
	Title = {{The Eleventh and Twelfth Data Releases of the Sloan Digital Sky Survey: Final Data from SDSS-III}},
	Volume = 219,
	Year = 2015,
	Bdsk-Url-1 = {http://dx.doi.org/10.1088/0067-0049/219/1/12}}

@book{Kepler:1609,
	Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
	Adsurl = {http://adsabs.harvard.edu/abs/1609anov.book.....K},
	Author = {{Kepler}, J.},
	Booktitle = {(Pragae) 1609},
	Date-Added = {2016-09-04 18:42:02 +0000},
	Date-Modified = {2016-09-04 18:51:56 +0000},
	Keywords = {ASTRONOMY: EARLY WORKS TO 1800},
	Title = {{Astronomia nova.}},
	Year = 1609}

repository: HWRix/thejoker

repo_name: HWRix/thejoker


text:
/*
Cisco Intersight

Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advanced ways than the prior generations of tools. Cisco Intersight provides an integrated and intuitive management experience for resources in the traditional data center as well as at the edge. With flexible deployment options to address complex security needs, getting started with Intersight is quick and easy. Cisco Intersight has deep integration with Cisco UCS and HyperFlex systems allowing for remote deployment, configuration, and ongoing maintenance. The model-based deployment works for a single system in a remote location or hundreds of systems in a data center and enables rapid, standardized configuration and deployment. It also streamlines maintaining those systems whether you are working with small or very large configurations. The Intersight OpenAPI document defines the complete set of properties that are returned in the HTTP response. From that perspective, a client can expect that no additional properties are returned, unless these properties are explicitly defined in the OpenAPI document. However, when a client uses an older version of the Intersight OpenAPI document, the server may send additional properties because the software is more recent than the client. In that case, the client may receive properties that it does not know about. Some generated SDKs perform a strict validation of the HTTP response body against the OpenAPI document.

API version: 1.0.11-13010
Contact: intersight@cisco.com
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package intersight

import (
	"encoding/json"
	"reflect"
	"strings"
)

// SnmpPolicyInventory Policy to configure SNMP settings on endpoint.
type SnmpPolicyInventory struct {
	PolicyAbstractPolicyInventory
	// The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.
	ClassId string `json:"ClassId"`
	// The fully-qualified name of the instantiated, concrete type. The value should be the same as the 'ClassId' property.
	ObjectType string `json:"ObjectType"`
	// The default SNMPv1, SNMPv2c community name or SNMPv3 username to include on any trap messages sent to the SNMP host. The name can be 18 characters long.
	AccessCommunityString *string `json:"AccessCommunityString,omitempty"`
	// Controls access to the information in the inventory tables. Applicable only for SNMPv1 and SNMPv2c users. * `Disabled` - Blocks access to the information in the inventory tables. * `Limited` - Partial access to read the information in the inventory tables. * `Full` - Full access to read the information in the inventory tables.
	CommunityAccess *string `json:"CommunityAccess,omitempty"`
	// State of the SNMP Policy on the endpoint. If enabled, the endpoint sends SNMP traps to the designated host.
	Enabled *bool `json:"Enabled,omitempty"`
	// User-defined unique identification of the static engine.
	EngineId *string `json:"EngineId,omitempty"`
	// Port on which Cisco IMC SNMP agent runs. Enter a value between 1-65535. Reserved ports not allowed (22, 23, 80, 123, 389, 443, 623, 636, 2068, 3268, 3269).
	SnmpPort  *int64     `json:"SnmpPort,omitempty"`
	SnmpTraps []SnmpTrap `json:"SnmpTraps,omitempty"`
	SnmpUsers []SnmpUser `json:"SnmpUsers,omitempty"`
	// Contact person responsible for the SNMP implementation. Enter a string up to 64 characters, such as an email address or a name and telephone number.
	SysContact *string `json:"SysContact,omitempty"`
	// Location of host on which the SNMP agent (server) runs.
	SysLocation *string `json:"SysLocation,omitempty"`
	// SNMP community group used for sending SNMP trap to other devices. Valid only for SNMPv2c users.
	TrapCommunity *string `json:"TrapCommunity,omitempty"`
	// State of the SNMP v2c on the endpoint. If enabled, the endpoint sends SNMP v2c properties to the designated host.
	V2Enabled *bool `json:"V2Enabled,omitempty"`
	// State of the SNMP v3 on the endpoint. If enabled, the endpoint sends SNMP v3 properties to the designated host.
	V3Enabled            *bool                 `json:"V3Enabled,omitempty"`
	TargetMo             *MoBaseMoRelationship `json:"TargetMo,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _SnmpPolicyInventory SnmpPolicyInventory

// NewSnmpPolicyInventory instantiates a new SnmpPolicyInventory object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewSnmpPolicyInventory(classId string, objectType string) *SnmpPolicyInventory {
	this := SnmpPolicyInventory{}
	this.ClassId = classId
	this.ObjectType = objectType
	return &this
}

// NewSnmpPolicyInventoryWithDefaults instantiates a new SnmpPolicyInventory object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewSnmpPolicyInventoryWithDefaults() *SnmpPolicyInventory {
	this := SnmpPolicyInventory{}
	var classId string = "snmp.PolicyInventory"
	this.ClassId = classId
	var objectType string = "snmp.PolicyInventory"
	this.ObjectType = objectType
	return &this
}

// GetClassId returns the ClassId field value
func (o *SnmpPolicyInventory) GetClassId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ClassId
}

// GetClassIdOk returns a tuple with the ClassId field value
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetClassIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.ClassId, true
}

// SetClassId sets field value
func (o *SnmpPolicyInventory) SetClassId(v string) {
	o.ClassId = v
}

// GetObjectType returns the ObjectType field value
func (o *SnmpPolicyInventory) GetObjectType() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ObjectType
}

// GetObjectTypeOk returns a tuple with the ObjectType field value
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetObjectTypeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.ObjectType, true
}

// SetObjectType sets field value
func (o *SnmpPolicyInventory) SetObjectType(v string) {
	o.ObjectType = v
}

// GetAccessCommunityString returns the AccessCommunityString field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetAccessCommunityString() string {
	if o == nil || o.AccessCommunityString == nil {
		var ret string
		return ret
	}
	return *o.AccessCommunityString
}

// GetAccessCommunityStringOk returns a tuple with the AccessCommunityString field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetAccessCommunityStringOk() (*string, bool) {
	if o == nil || o.AccessCommunityString == nil {
		return nil, false
	}
	return o.AccessCommunityString, true
}

// HasAccessCommunityString returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasAccessCommunityString() bool {
	if o != nil && o.AccessCommunityString != nil {
		return true
	}

	return false
}

// SetAccessCommunityString gets a reference to the given string and assigns it to the AccessCommunityString field.
func (o *SnmpPolicyInventory) SetAccessCommunityString(v string) {
	o.AccessCommunityString = &v
}

// GetCommunityAccess returns the CommunityAccess field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetCommunityAccess() string {
	if o == nil || o.CommunityAccess == nil {
		var ret string
		return ret
	}
	return *o.CommunityAccess
}

// GetCommunityAccessOk returns a tuple with the CommunityAccess field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetCommunityAccessOk() (*string, bool) {
	if o == nil || o.CommunityAccess == nil {
		return nil, false
	}
	return o.CommunityAccess, true
}

// HasCommunityAccess returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasCommunityAccess() bool {
	if o != nil && o.CommunityAccess != nil {
		return true
	}

	return false
}

// SetCommunityAccess gets a reference to the given string and assigns it to the CommunityAccess field.
func (o *SnmpPolicyInventory) SetCommunityAccess(v string) {
	o.CommunityAccess = &v
}

// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetEnabled() bool {
	if o == nil || o.Enabled == nil {
		var ret bool
		return ret
	}
	return *o.Enabled
}

// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetEnabledOk() (*bool, bool) {
	if o == nil || o.Enabled == nil {
		return nil, false
	}
	return o.Enabled, true
}

// HasEnabled returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasEnabled() bool {
	if o != nil && o.Enabled != nil {
		return true
	}

	return false
}

// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *SnmpPolicyInventory) SetEnabled(v bool) {
	o.Enabled = &v
}

// GetEngineId returns the EngineId field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetEngineId() string {
	if o == nil || o.EngineId == nil {
		var ret string
		return ret
	}
	return *o.EngineId
}

// GetEngineIdOk returns a tuple with the EngineId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetEngineIdOk() (*string, bool) {
	if o == nil || o.EngineId == nil {
		return nil, false
	}
	return o.EngineId, true
}

// HasEngineId returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasEngineId() bool {
	if o != nil && o.EngineId != nil {
		return true
	}

	return false
}

// SetEngineId gets a reference to the given string and assigns it to the EngineId field.
func (o *SnmpPolicyInventory) SetEngineId(v string) {
	o.EngineId = &v
}

// GetSnmpPort returns the SnmpPort field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetSnmpPort() int64 {
	if o == nil || o.SnmpPort == nil {
		var ret int64
		return ret
	}
	return *o.SnmpPort
}

// GetSnmpPortOk returns a tuple with the SnmpPort field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetSnmpPortOk() (*int64, bool) {
	if o == nil || o.SnmpPort == nil {
		return nil, false
	}
	return o.SnmpPort, true
}

// HasSnmpPort returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasSnmpPort() bool {
	if o != nil && o.SnmpPort != nil {
		return true
	}

	return false
}

// SetSnmpPort gets a reference to the given int64 and assigns it to the SnmpPort field.
func (o *SnmpPolicyInventory) SetSnmpPort(v int64) {
	o.SnmpPort = &v
}

// GetSnmpTraps returns the SnmpTraps field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SnmpPolicyInventory) GetSnmpTraps() []SnmpTrap {
	if o == nil {
		var ret []SnmpTrap
		return ret
	}
	return o.SnmpTraps
}

// GetSnmpTrapsOk returns a tuple with the SnmpTraps field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SnmpPolicyInventory) GetSnmpTrapsOk() ([]SnmpTrap, bool) {
	if o == nil || o.SnmpTraps == nil {
		return nil, false
	}
	return o.SnmpTraps, true
}

// HasSnmpTraps returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasSnmpTraps() bool {
	if o != nil && o.SnmpTraps != nil {
		return true
	}

	return false
}

// SetSnmpTraps gets a reference to the given []SnmpTrap and assigns it to the SnmpTraps field.
func (o *SnmpPolicyInventory) SetSnmpTraps(v []SnmpTrap) {
	o.SnmpTraps = v
}

// GetSnmpUsers returns the SnmpUsers field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SnmpPolicyInventory) GetSnmpUsers() []SnmpUser {
	if o == nil {
		var ret []SnmpUser
		return ret
	}
	return o.SnmpUsers
}

// GetSnmpUsersOk returns a tuple with the SnmpUsers field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *SnmpPolicyInventory) GetSnmpUsersOk() ([]SnmpUser, bool) {
	if o == nil || o.SnmpUsers == nil {
		return nil, false
	}
	return o.SnmpUsers, true
}

// HasSnmpUsers returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasSnmpUsers() bool {
	if o != nil && o.SnmpUsers != nil {
		return true
	}

	return false
}

// SetSnmpUsers gets a reference to the given []SnmpUser and assigns it to the SnmpUsers field.
func (o *SnmpPolicyInventory) SetSnmpUsers(v []SnmpUser) {
	o.SnmpUsers = v
}

// GetSysContact returns the SysContact field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetSysContact() string {
	if o == nil || o.SysContact == nil {
		var ret string
		return ret
	}
	return *o.SysContact
}

// GetSysContactOk returns a tuple with the SysContact field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetSysContactOk() (*string, bool) {
	if o == nil || o.SysContact == nil {
		return nil, false
	}
	return o.SysContact, true
}

// HasSysContact returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasSysContact() bool {
	if o != nil && o.SysContact != nil {
		return true
	}

	return false
}

// SetSysContact gets a reference to the given string and assigns it to the SysContact field.
func (o *SnmpPolicyInventory) SetSysContact(v string) {
	o.SysContact = &v
}

// GetSysLocation returns the SysLocation field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetSysLocation() string {
	if o == nil || o.SysLocation == nil {
		var ret string
		return ret
	}
	return *o.SysLocation
}

// GetSysLocationOk returns a tuple with the SysLocation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetSysLocationOk() (*string, bool) {
	if o == nil || o.SysLocation == nil {
		return nil, false
	}
	return o.SysLocation, true
}

// HasSysLocation returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasSysLocation() bool {
	if o != nil && o.SysLocation != nil {
		return true
	}

	return false
}

// SetSysLocation gets a reference to the given string and assigns it to the SysLocation field.
func (o *SnmpPolicyInventory) SetSysLocation(v string) {
	o.SysLocation = &v
}

// GetTrapCommunity returns the TrapCommunity field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetTrapCommunity() string {
	if o == nil || o.TrapCommunity == nil {
		var ret string
		return ret
	}
	return *o.TrapCommunity
}

// GetTrapCommunityOk returns a tuple with the TrapCommunity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetTrapCommunityOk() (*string, bool) {
	if o == nil || o.TrapCommunity == nil {
		return nil, false
	}
	return o.TrapCommunity, true
}

// HasTrapCommunity returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasTrapCommunity() bool {
	if o != nil && o.TrapCommunity != nil {
		return true
	}

	return false
}

// SetTrapCommunity gets a reference to the given string and assigns it to the TrapCommunity field.
func (o *SnmpPolicyInventory) SetTrapCommunity(v string) {
	o.TrapCommunity = &v
}

// GetV2Enabled returns the V2Enabled field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetV2Enabled() bool {
	if o == nil || o.V2Enabled == nil {
		var ret bool
		return ret
	}
	return *o.V2Enabled
}

// GetV2EnabledOk returns a tuple with the V2Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetV2EnabledOk() (*bool, bool) {
	if o == nil || o.V2Enabled == nil {
		return nil, false
	}
	return o.V2Enabled, true
}

// HasV2Enabled returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasV2Enabled() bool {
	if o != nil && o.V2Enabled != nil {
		return true
	}

	return false
}

// SetV2Enabled gets a reference to the given bool and assigns it to the V2Enabled field.
func (o *SnmpPolicyInventory) SetV2Enabled(v bool) {
	o.V2Enabled = &v
}

// GetV3Enabled returns the V3Enabled field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetV3Enabled() bool {
	if o == nil || o.V3Enabled == nil {
		var ret bool
		return ret
	}
	return *o.V3Enabled
}

// GetV3EnabledOk returns a tuple with the V3Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetV3EnabledOk() (*bool, bool) {
	if o == nil || o.V3Enabled == nil {
		return nil, false
	}
	return o.V3Enabled, true
}

// HasV3Enabled returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasV3Enabled() bool {
	if o != nil && o.V3Enabled != nil {
		return true
	}

	return false
}

// SetV3Enabled gets a reference to the given bool and assigns it to the V3Enabled field.
func (o *SnmpPolicyInventory) SetV3Enabled(v bool) {
	o.V3Enabled = &v
}

// GetTargetMo returns the TargetMo field value if set, zero value otherwise.
func (o *SnmpPolicyInventory) GetTargetMo() MoBaseMoRelationship {
	if o == nil || o.TargetMo == nil {
		var ret MoBaseMoRelationship
		return ret
	}
	return *o.TargetMo
}

// GetTargetMoOk returns a tuple with the TargetMo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SnmpPolicyInventory) GetTargetMoOk() (*MoBaseMoRelationship, bool) {
	if o == nil || o.TargetMo == nil {
		return nil, false
	}
	return o.TargetMo, true
}

// HasTargetMo returns a boolean if a field has been set.
func (o *SnmpPolicyInventory) HasTargetMo() bool {
	if o != nil && o.TargetMo != nil {
		return true
	}

	return false
}

// SetTargetMo gets a reference to the given MoBaseMoRelationship and assigns it to the TargetMo field.
func (o *SnmpPolicyInventory) SetTargetMo(v MoBaseMoRelationship) {
	o.TargetMo = &v
}

func (o SnmpPolicyInventory) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	serializedPolicyAbstractPolicyInventory, errPolicyAbstractPolicyInventory := json.Marshal(o.PolicyAbstractPolicyInventory)
	if errPolicyAbstractPolicyInventory != nil {
		return []byte{}, errPolicyAbstractPolicyInventory
	}
	errPolicyAbstractPolicyInventory = json.Unmarshal([]byte(serializedPolicyAbstractPolicyInventory), &toSerialize)
	if errPolicyAbstractPolicyInventory != nil {
		return []byte{}, errPolicyAbstractPolicyInventory
	}
	if true {
		toSerialize["ClassId"] = o.ClassId
	}
	if true {
		toSerialize["ObjectType"] = o.ObjectType
	}
	if o.AccessCommunityString != nil {
		toSerialize["AccessCommunityString"] = o.AccessCommunityString
	}
	if o.CommunityAccess != nil {
		toSerialize["CommunityAccess"] = o.CommunityAccess
	}
	if o.Enabled != nil {
		toSerialize["Enabled"] = o.Enabled
	}
	if o.EngineId != nil {
		toSerialize["EngineId"] = o.EngineId
	}
	if o.SnmpPort != nil {
		toSerialize["SnmpPort"] = o.SnmpPort
	}
	if o.SnmpTraps != nil {
		toSerialize["SnmpTraps"] = o.SnmpTraps
	}
	if o.SnmpUsers != nil {
		toSerialize["SnmpUsers"] = o.SnmpUsers
	}
	if o.SysContact != nil {
		toSerialize["SysContact"] = o.SysContact
	}
	if o.SysLocation != nil {
		toSerialize["SysLocation"] = o.SysLocation
	}
	if o.TrapCommunity != nil {
		toSerialize["TrapCommunity"] = o.TrapCommunity
	}
	if o.V2Enabled != nil {
		toSerialize["V2Enabled"] = o.V2Enabled
	}
	if o.V3Enabled != nil {
		toSerialize["V3Enabled"] = o.V3Enabled
	}
	if o.TargetMo != nil {
		toSerialize["TargetMo"] = o.TargetMo
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return json.Marshal(toSerialize)
}

func (o *SnmpPolicyInventory) UnmarshalJSON(bytes []byte) (err error) {
	type SnmpPolicyInventoryWithoutEmbeddedStruct struct {
		// The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.
		ClassId string `json:"ClassId"`
		// The fully-qualified name of the instantiated, concrete type. The value should be the same as the 'ClassId' property.
		ObjectType string `json:"ObjectType"`
		// The default SNMPv1, SNMPv2c community name or SNMPv3 username to include on any trap messages sent to the SNMP host. The name can be 18 characters long.
		AccessCommunityString *string `json:"AccessCommunityString,omitempty"`
		// Controls access to the information in the inventory tables. Applicable only for SNMPv1 and SNMPv2c users. * `Disabled` - Blocks access to the information in the inventory tables. * `Limited` - Partial access to read the information in the inventory tables. * `Full` - Full access to read the information in the inventory tables.
		CommunityAccess *string `json:"CommunityAccess,omitempty"`
		// State of the SNMP Policy on the endpoint. If enabled, the endpoint sends SNMP traps to the designated host.
		Enabled *bool `json:"Enabled,omitempty"`
		// User-defined unique identification of the static engine.
		EngineId *string `json:"EngineId,omitempty"`
		// Port on which Cisco IMC SNMP agent runs. Enter a value between 1-65535. Reserved ports not allowed (22, 23, 80, 123, 389, 443, 623, 636, 2068, 3268, 3269).
		SnmpPort  *int64     `json:"SnmpPort,omitempty"`
		SnmpTraps []SnmpTrap `json:"SnmpTraps,omitempty"`
		SnmpUsers []SnmpUser `json:"SnmpUsers,omitempty"`
		// Contact person responsible for the SNMP implementation. Enter a string up to 64 characters, such as an email address or a name and telephone number.
		SysContact *string `json:"SysContact,omitempty"`
		// Location of host on which the SNMP agent (server) runs.
		SysLocation *string `json:"SysLocation,omitempty"`
		// SNMP community group used for sending SNMP trap to other devices. Valid only for SNMPv2c users.
		TrapCommunity *string `json:"TrapCommunity,omitempty"`
		// State of the SNMP v2c on the endpoint. If enabled, the endpoint sends SNMP v2c properties to the designated host.
		V2Enabled *bool `json:"V2Enabled,omitempty"`
		// State of the SNMP v3 on the endpoint. If enabled, the endpoint sends SNMP v3 properties to the designated host.
		V3Enabled *bool                 `json:"V3Enabled,omitempty"`
		TargetMo  *MoBaseMoRelationship `json:"TargetMo,omitempty"`
	}

	varSnmpPolicyInventoryWithoutEmbeddedStruct := SnmpPolicyInventoryWithoutEmbeddedStruct{}

	err = json.Unmarshal(bytes, &varSnmpPolicyInventoryWithoutEmbeddedStruct)
	if err == nil {
		varSnmpPolicyInventory := _SnmpPolicyInventory{}
		varSnmpPolicyInventory.ClassId = varSnmpPolicyInventoryWithoutEmbeddedStruct.ClassId
		varSnmpPolicyInventory.ObjectType = varSnmpPolicyInventoryWithoutEmbeddedStruct.ObjectType
		varSnmpPolicyInventory.AccessCommunityString = varSnmpPolicyInventoryWithoutEmbeddedStruct.AccessCommunityString
		varSnmpPolicyInventory.CommunityAccess = varSnmpPolicyInventoryWithoutEmbeddedStruct.CommunityAccess
		varSnmpPolicyInventory.Enabled = varSnmpPolicyInventoryWithoutEmbeddedStruct.Enabled
		varSnmpPolicyInventory.EngineId = varSnmpPolicyInventoryWithoutEmbeddedStruct.EngineId
		varSnmpPolicyInventory.SnmpPort = varSnmpPolicyInventoryWithoutEmbeddedStruct.SnmpPort
		varSnmpPolicyInventory.SnmpTraps = varSnmpPolicyInventoryWithoutEmbeddedStruct.SnmpTraps
		varSnmpPolicyInventory.SnmpUsers = varSnmpPolicyInventoryWithoutEmbeddedStruct.SnmpUsers
		varSnmpPolicyInventory.SysContact = varSnmpPolicyInventoryWithoutEmbeddedStruct.SysContact
		varSnmpPolicyInventory.SysLocation = varSnmpPolicyInventoryWithoutEmbeddedStruct.SysLocation
		varSnmpPolicyInventory.TrapCommunity = varSnmpPolicyInventoryWithoutEmbeddedStruct.TrapCommunity
		varSnmpPolicyInventory.V2Enabled = varSnmpPolicyInventoryWithoutEmbeddedStruct.V2Enabled
		varSnmpPolicyInventory.V3Enabled = varSnmpPolicyInventoryWithoutEmbeddedStruct.V3Enabled
		varSnmpPolicyInventory.TargetMo = varSnmpPolicyInventoryWithoutEmbeddedStruct.TargetMo
		*o = SnmpPolicyInventory(varSnmpPolicyInventory)
	} else {
		return err
	}

	varSnmpPolicyInventory := _SnmpPolicyInventory{}

	err = json.Unmarshal(bytes, &varSnmpPolicyInventory)
	if err == nil {
		o.PolicyAbstractPolicyInventory = varSnmpPolicyInventory.PolicyAbstractPolicyInventory
	} else {
		return err
	}

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
		delete(additionalProperties, "ClassId")
		delete(additionalProperties, "ObjectType")
		delete(additionalProperties, "AccessCommunityString")
		delete(additionalProperties, "CommunityAccess")
		delete(additionalProperties, "Enabled")
		delete(additionalProperties, "EngineId")
		delete(additionalProperties, "SnmpPort")
		delete(additionalProperties, "SnmpTraps")
		delete(additionalProperties, "SnmpUsers")
		delete(additionalProperties, "SysContact")
		delete(additionalProperties, "SysLocation")
		delete(additionalProperties, "TrapCommunity")
		delete(additionalProperties, "V2Enabled")
		delete(additionalProperties, "V3Enabled")
		delete(additionalProperties, "TargetMo")

		// remove fields from embedded structs
		reflectPolicyAbstractPolicyInventory := reflect.ValueOf(o.PolicyAbstractPolicyInventory)
		for i := 0; i < reflectPolicyAbstractPolicyInventory.Type().NumField(); i++ {
			t := reflectPolicyAbstractPolicyInventory.Type().Field(i)

			if jsonTag := t.Tag.Get("json"); jsonTag != "" {
				fieldName := ""
				if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 {
					fieldName = jsonTag[:commaIdx]
				} else {
					fieldName = jsonTag
				}
				if fieldName != "AdditionalProperties" {
					delete(additionalProperties, fieldName)
				}
			}
		}

		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableSnmpPolicyInventory struct {
	value *SnmpPolicyInventory
	isSet bool
}

func (v NullableSnmpPolicyInventory) Get() *SnmpPolicyInventory {
	return v.value
}

func (v *NullableSnmpPolicyInventory) Set(val *SnmpPolicyInventory) {
	v.value = val
	v.isSet = true
}

func (v NullableSnmpPolicyInventory) IsSet() bool {
	return v.isSet
}

func (v *NullableSnmpPolicyInventory) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableSnmpPolicyInventory(val *SnmpPolicyInventory) *NullableSnmpPolicyInventory {
	return &NullableSnmpPolicyInventory{value: val, isSet: true}
}

func (v NullableSnmpPolicyInventory) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableSnmpPolicyInventory) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}

repository: CiscoDevNet/intersight-go

repo_name: CiscoDevNet/intersight-go

gha_language: Shell